迅捷的4.0:覆盖'prepare'必须与覆盖它的声明一样可用 [英] swift 4.0: Overriding 'prepare' must be as available as declaration it overrides

查看:145
本文介绍了迅捷的4.0:覆盖'prepare'必须与覆盖它的声明一样可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将Apple的ARKit示例应用程序集成到我的应用程序中.由于ARKit只是一项附加功能,因此我需要支持较低版本的iOS.我在所有ARKit示例应用程序类中添加了@available(iOS 11.0,*)标记...几乎可以正常工作,除了以下1个错误:覆盖'prepare'必须与覆盖的声明一样可用".您知道如何解决此问题吗?

I was trying to integrate Apple's ARKit example app into my app. As ARKit is only an additional feature, so I need to support lower versions of iOS. I added @available(iOS 11.0, *) tag to all the ARKit example app classes...It almost works except this 1 error: "Overriding 'prepare' must be as available as declaration it overrides". Any idea how can I resolve this issue ?

Xcode错误图片

推荐答案

移动:

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
     //...
}

直接到ViewController文件.

它独立于UIPopoverPresentationControllerDelegate协议.

这篇关于迅捷的4.0:覆盖'prepare'必须与覆盖它的声明一样可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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