针对目标macOS10.15使用Xcode12构建错误
从 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!
回答
感谢@Raja Kishan,答案很简单,在创建新项目时,在 Lifecycle 的选项中选择 App Delegate 选项。
- Wow - two days searching the internet and a full reinstall and this was ALL I needed - thanks...! Wish I could give this +10.