Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

swift 4.0: Overriding 'prepare' must be as available as declaration it overrides

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 error image

like image 236
guocongyu Avatar asked Sep 27 '17 01:09

guocongyu


1 Answers

Move :

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

to the ViewController file directly.

It is independent of the UIPopoverPresentationControllerDelegate protocol.

like image 143
malinois Avatar answered Sep 30 '22 17:09

malinois