试图使iOS 13项目与iOS 12兼容 [英] Trying to make iOS 13 project compatible with iOS 12

查看:195
本文介绍了试图使iOS 13项目与iOS 12兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使为iOS 13设置的Xcode项目可以与iOS 10甚至12的目标一起使用.我正在使用Xcode 10来实现Swift 3兼容性.

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>) {

在场景委托中:

@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {

但是我得到了:

使用未声明类型的'UISceneConfiguration','UIWindowSceneDelegate','UIScene','UISceneSession'

Use of undeclared type 'UISceneConfiguration', 'UIWindowSceneDelegate', 'UIScene', 'UISceneSession'

我该如何解决?我看不出我还能做什么.

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

推荐答案

我正在使用Xcode 10来实现Swift 3兼容性.

I'm using Xcode 10 for Swift 3 compatibility.

就是这个问题.您不能使用Xcode 10提及iOS 13类.它对它们一无所知.如果要链接到iOS 13 SDK,则必须完全在Xcode 11中工作.

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.

这篇关于试图使iOS 13项目与iOS 12兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆