Xcode 8 (Swift 2.3): Unwind Segues Don't Get Linked Correctly
| Originator: | flavio | ||
| Number: | rdar://28609440 | Date Originated: | 2016-10-04 |
| Status: | Duplicate of 25220368 (Closed) | Resolved: | |
| Product: | Xcode 8 | Product Version: | 8A218a |
| Classification: | Bug | Reproducible: | Always |
Summary: Using Swift 2.3 on Xcode 8, when a unwind segue is created using a Storyboard, Xcode tries to connect it to a matching method in the view controller by appending "WithSegue:" to the method name, which causes a mismatch with the unwind segue and it doesn't work. Attached is an example project. Steps to Reproduce: 1 - Create a new project and configure it to use Swift 2.3 2 - In a UIViewController, create a @IBAction method to receive the unwinding segue. 3 - In a storyboard, create an exit segue that links to the method created in step 2 (note that "WithSegue" is appended to the method contract) 4 - Run the app and execute the segue action Expected Results: The presented view controller should be dismissed to the target view controller. Actual Results: The presented view controller isn't dismissed and nothing happens. Version: Xcode 8.0 (8A218a) Notes: A possible workaround is to change the target method name by appending "WithSegue" *after* the segue has been created in the storyboard. I've attached a new project with an example. Note that if a new exit segue is created, Xcode tries to link it with a method named "unwindToViewControllerWithSegueWithSegue" Configuration: Running on a brand new project on Xcode 8.0 (8A218a) running on a MacBook Pro Retina 13" Late-13 with macOS 10.11.6 Attachments: 'Segues Example.zip' was successfully uploaded.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!