I downloaded Apple's MyLife sample project and attempted to build and run it using Xcode 8 beta 6.
There are two places where a view controller has implemented the prepare(for:sender:)
call to do stuff before a storyboard segue is performed.
override func prepare(for segue: UIStoryboardSegue, sender: AnyObject?) {
That line has an error saying "Method does not override any method from its superclass".
If I remove the override, the app builds but the method isn't called when it should be.
Unlike the segues that you use to present view controllers, an unwind segue promises the dismissal of the current view controller without promising a specific target for the resulting transition. Instead, UIKit determines the target of an unwind segue programmatically at runtime.
prepare(for:sender:)Notifies the view controller that a segue is about to be performed.
An object that prepares for and performs the visual transition between two view controllers.
The method signature has changed. sender
is now Any?
instead of AnyObject?
override func prepare(for segue: UIStoryboardSegue, sender: Any?)
This is to coincide with the changes to how Swift is bridged with obj-c, described here under "New in Xcode 8 beta 6 - Swift Compiler"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With