简体   繁体   中英

How to work with Storyboard Unwind Segue in Mac OS X

I have a good understanding how to work with Storyboard, Segues and Unwind-Segues on iOS. For porting my App to OS XI need to rewrite the UI and want to do this with the OS X storyboards. However the Unwinding-Mechanism from iOS seems not be the same like in iOS. How to Unwind a ViewController-Scene on Mac OS X. Where is that "Exit"-Button in the ViewController ?

Unlike iOS where the screen is the real estate. In Mac, we have plenty of space. You see, from the builtin segues, most of them are just a way to show up a new dialog. And, when you are done with it. You don't really need to go back somewhere, all you need is a way to close that dialog down.

To decoupling things a bit further, instead of unwinding which require selector from other view controller. They encourage us to use dismissController: from the view controller we want to close it down. This method will dismiss the view controller using the same segue animator that presented it.

-(IBAction)backDidTap:(id)sender {
    [self dismissController: nil];
} 

In other words, this is one step unwinding.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM