Does anyone know what the new Exit icon is used for when editing storyboards using Xcode 4.5?

rsswtmr picture rsswtmr · Sep 24, 2012 · Viewed 29.5k times · Source

Right-clicking the Exit icon yields an empty window. Can't Ctrl-drag a connection to any IB elements or corresponding source files. Docs give no love. Doesn't appear in nib files, only storyboards. My assumption is that it's a corollary to segues, but I don't see any new methods to back it up. Anyone?

Answer

Eric picture Eric · Nov 18, 2012

I had a hard time following the accepted answer so here is more detail.

Given the photo below on view controller C you can "exit" back to any view controller in the segue path.

enter image description here

ViewController A you can write:

- (IBAction)done:(UIStoryboardSegue *)segue {
    // Optional place to read data from closing controller
}

ViewController B you can write:

- (IBAction)back:(UIStoryboardSegue *)segue {
    // Optional place to read data from closing controller
}

ViewController C you control drag from "back" button to the green exit option and select back: ViewController C you control drag from "done" button to the green exit option and select done: enter image description here

Note: Even though the methods are on other view controllers they show up for the ViewController C's exit. Control dragging and selecting a method defines which ViewController to unwind to.