Dis*_*sco 4 macos xcode swiftui
从 Xcode 12.3 开始,当您使用 macOS 目标创建新的 SwiftUI 项目时,Xcode 默认目标为 11.0 (Big Sur)。不更改默认创建的默认“hello world”应用程序中的一行代码,然后我将目标更改为 macOS 10.15(这是我仍在使用的)默认项目 swift 文件将不再构建。:-
@main
struct catalinaApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}```
3 Errors: @main, 'Scene' and WindowGroup is only available in macOS 11.0 or newer
How can I alter the project/above file to correctly build the default app on Catalina? (10.15) ?
thanks in advance!
Run Code Online (Sandbox Code Playgroud)
感谢@Raja Kishan,答案很简单,在创建新项目时,在 Lifecycle 的选项中选择 App Delegate 选项。
| 归档时间: |
|
| 查看次数: |
902 次 |
| 最近记录: |