简体   繁体   English

尝试使 iOS 13 项目与 iOS 12 兼容

[英]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.

相关问题 有一个与 iOS 11 - iO12 兼容的版本和另一个与 iOS13 (swiftUI) 兼容的版本 - Have a version compatible with iOS 11 - iO12 and another with iOS13 (swiftUI) 如何实现苹果登录到iOS12兼容项目 - How to implement sign in with apple to iOS12 compatible project Xcode 12 项目与 iOS 13 SwiftUI 支持:未调用 SceneDelegate 函数 - Xcode 12 project with iOS 13 SwiftUI support: SceneDelegate functions not invoked touchesBegan 在 iOS 12 中被调用,但在 iOS 13 中不被调用 - touchesBegan is called in iOS 12 but is not called in iOS 13 UITableViewRowAction 的图标显示在 iOS 13 上,但不在 iOS 12 上 - Icon for UITableViewRowAction is shown on iOS 13, but not on iOS 12 MKStoreKit是否仍然维护并与iOS 12完全兼容? - Is MKStoreKit still maintained and fully compatible to iOS 12? iOS 12 / 13 程序化视图创建 - iOS 12 / 13 Programmatic View Creation iOS 12 和 13 中的 UISearchbar UI 不同且不正确 - UISearchbar UI in iOS 12 and 13 are different and not correct 支持 iOS 12 和 13 时的 AppDelegate 和 SceneDelegate - AppDelegate and SceneDelegate when supporting iOS 12 and 13 使iPhone应用程序与iOS 3兼容 - Make iPhone app compatible with iOS 3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM