Triggering a segue from code
Triggering a segue from code
For reference, I have a sample project location at
https://github.com/ericgorr/nspanel_show
It is a Document Based and Storyboard application.
On my main window, I have a toolbar with an Toolbar Item called 'Inspector'. I have defined a segue between this item and my Inspector Utility Panel called "Show Inspector". When I press the Inspector toolbar item, the utility panel does show as expected. I can close the panel by pushing the standard window close button.
What I would like to do is trigger my "Show Inspector" segue when I push the "Show Panel" button. I have tried the code:
@IBAction func showMyPanel( _ sender: AnyObject )
{
NSLog( "How do I show the panel?" )
self.performSegue( withIdentifier: "Show Inspector", sender: self )
}
While I do see the log message 'How do I..', my utility panel is not shown.
How can I get this work?
Here is an image that shows the basic setup in Interface Builder.
https://github.com/ericgorr/nspanel_show/blob/master/extra/Screen Shot 2016-09-17 at 8.13.23 PM.png
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden