Is there a way to capture a segue generated from the menu in Application Scene? My searches have not been forthcoming.
I have a Preferences menu item that is under the App name like most other Apple macOS applications, but unlike other segues, that segue is not firing the prepare or shouldPerformSegue methods.
I want to trap the segue like I do with other segues when they fire the above mentioned methods.
CodePudding user response:
A reliable way is:
- Connect the segue from the main view controller to the Preferences controller.
- In the main view controller create an
IBAction
. In the action callperformSegue
- Connect the menu item to the First Responder of the application scene (red cube). Select the IBAction.