[英]Trying to make iOS 13 project compatible with iOS 12
I am trying to make an Xcode project that was set up for iOS 13 work with a target of iOS 10 or even 12. I'm using Xcode 10 for Swift 3 compatibility.我正在尝试使为 iOS 13 设置的 Xcode 项目与 iOS 10 甚至 12 的目标一起使用。我正在使用 Xcode 10 来兼容 Swift 3。
According to the advice here: Xcode 11 backward compatibility I have added @available(iOS 13.0, *)
in the places it was recommended to add it, and I have also declared var window : UIWindow?
根据这里的建议: Xcode 11 向后兼容性我在建议添加它的地方添加了@available(iOS 13.0, *)
,并且我还声明了var window : UIWindow?
in the AppDelegate class.在 AppDelegate 类中。
// MARK: UISceneSession Lifecycle
@available(iOS 13.0, *)
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
... ...
@available(iOS 13.0, *)
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
In Scene Delegate:在场景委托中:
@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
But I am getting:但我得到:
Use of undeclared type 'UISceneConfiguration', 'UIWindowSceneDelegate', 'UIScene', 'UISceneSession'使用未声明的类型 'UISceneConfiguration'、'UIWindowSceneDelegate'、'UIScene'、'UISceneSession'
How can I fix this?我怎样才能解决这个问题? I don't see what else I can do.我看不出我还能做什么。
I'm using Xcode 10 for Swift 3 compatibility.我正在使用 Xcode 10 来兼容 Swift 3。
That's the problem.那就是问题所在。 You cannot mention iOS 13 classes using Xcode 10. It knows nothing about them.您不能使用 Xcode 10 提及 iOS 13 类。它对它们一无所知。 You must work entirely within Xcode 11 if you want to link against the iOS 13 SDK.如果您想链接到 iOS 13 SDK,您必须完全在 Xcode 11 中工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.