Home > other >  Capture Storyboard Segue from application menu
Capture Storyboard Segue from application menu

Time:03-02

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:

  1. Connect the segue from the main view controller to the Preferences controller.
  2. In the main view controller create an IBAction. In the action call performSegue
  3. Connect the menu item to the First Responder of the application scene (red cube). Select the IBAction.
  • Related