Trying to make iOS 13 project compatible with iOS 12

两盒软妹~` 提交于 2019-12-25 17:37:51

问题


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.

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? in the AppDelegate class.

// 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'

How can I fix this? I don't see what else I can do.


回答1:


I'm using Xcode 10 for Swift 3 compatibility.

That’s the problem. You cannot mention iOS 13 classes using Xcode 10. It knows nothing about them. You must work entirely within Xcode 11 if you want to link against the iOS 13 SDK.



来源:https://stackoverflow.com/questions/59270611/trying-to-make-ios-13-project-compatible-with-ios-12

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!