可以在 Apple silicon 的 Mac 執⾏,畫⾯會是 iPad App 的樣⼦ 製作原⽣的 Mac App,可使⽤ macOS SDK 各種 Mac App 的差異 https://developer.apple.com/documentation/xcode/con f iguring-a-multiplatform-app-target
UI 元件樣式 & 功能的 SwiftUI modi f ier http://bit.ly/2IJ7cyd struct ContentView: View { var body: some View { Text("The best way to build an app is with Swift and SwiftUI") .font(.largeTitle) .foregroundColor(.orange) .padding() .background(.blue) .cornerRadius(10.0) .rotationEffect(.degrees(10)) .shadow(radius: 20) .padding() } } func cornerRadius(_ radius: CGFloat, antialiased: Bool = true) -> some View 得到新的 view,加了圓⾓效果
time; try breaking up the expression into distinct sub-expressions 錯誤的原因是因為 ViewBuilder 參數傳入的 closure 程式太複雜,解法是將某些程式另外 包成 function 或 computed property https://cutt.ly/sBczRMo 為什麼剛剛要另外定義 function calculateRange ? 要是你敢不定義,可怕的事會發⽣呀
Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates. 如果沒有加 @MainActor,會出現在背景 thread 發布資料改變的錯誤
preventing this process from reading networkd settings f ile at "/Library/Preferences/com.apple.networkd.plist", please add an exception • macOS App 很重視安全,所以預設不讓我們接觸網路,畢竟網路上藏著許多可怕的東⻄呀
There are multiple stickers icon set or app icon set instances named "AppIcon". /* com.apple.actool.compilation-results */ /Users/peterpan/Library/Developer/Xcode/DerivedData/MOPCONSwiftUIMultiplatform-cfaczzmiqqawtodqwqecwaayybgp/Build/Intermediates.noindex/ MOPCONSwiftUIMultiplatform.build/Debug-watchsimulator/WatchMOPCON Watch App.build/assetcatalog_generated_info.plist /Users/peterpan/Library/Developer/Xcode/DerivedData/MOPCONSwiftUIMultiplatform-cfaczzmiqqawtodqwqecwaayybgp/Build/Products/Debug-watchsimulator/ WatchMOPCON Watch App.app/Assets.car