简体   繁体   English

为什么我在 Xcode 10.1 中出现 swift 编译器错误

[英]Why I am getting swift compiler error in Xcode 10.1

I can't build my application it is continuously failing to build.我无法构建我的应用程序,它一直无法构建。 This is screenshot这是截图

If you see the https://developer.apple.com/documentation/uikit/uiscene documentation you can see that UIScene is supported from iOS 13.0+ and you have to use latest Xcode to use this functionality.如果您查看https://developer.apple.com/documentation/uikit/uiscene文档,您可以看到 iOS 13.0+ 支持 UIScene,您必须使用最新的 Xcode 才能使用此功能。

If you want to use Xcode 10.1 then you should not compile SceneDelegate.swift.如果你想使用 Xcode 10.1,那么你不应该编译 SceneDelegate.swift。

Since the UIWindowSceneDelegate is only available in iOS 13 and up, we'll need to exclude the entire SceneDelegate object if the app is compiled for iOS 12 or below.由于 UIWindowSceneDelegate 仅在 iOS 13 及更高版本中可用,如果应用程序是为 iOS 12 或更低版本编译的,我们需要排除整个 SceneDelegate 对象。

@available(iOS 13, *) @available(iOS 13, *)

Or we will remove this for all iOS versions.或者我们将为所有 iOS 版本删除它。

For better understanding how to use it for only iOS version 13 and above without getting compiling issues or how to remove this follow below link:-为了更好地了解如何仅在 iOS 13 及更高版本上使用它而不会出现编译问题或如何删除它,请点击以下链接:-

https://www.donnywals.com/add-ios-12-support-to-a-new-xcode-11-project/ https://www.donnywals.com/add-ios-12-support-to-a-new-xcode-11-project/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM