Xcode 6 Storyboard Unwind Segue with Swift Not Connecting to Exit

This is a known issue with Xcode 6:

Unwind segue actions declared in Swift classes are not recognized by Interface Builder

In order to get around it you need to:

  1. Change class MyViewController to @objc(MyViewController) class MyViewController
  2. Create an Objective-C header file with a category for MyViewController that redeclares the segue action.

    @interface MyViewController (Workaround)
    - (IBAction)unwindToMyViewController: (UIStoryboardSegue *)segue;
    @end
    
  3. In the storyboard, select the instance of MyViewController, clear its custom class, then
    set it back to MyViewController.

After these steps you are able to connect buttons to the exit item again.

Xcode 6 Release Notes PDF, Page 10

Leave a Comment