In my mainViewController i have a container. Inside this container are two ViewControllers. Now I made a function to switch between these two ViewControllers. This function is controlled by a pushbutton. This works as long as the pushbutton is inside the mainViewController. Now I want the pushButton to be inside the toolbar. It was possible to add a pushbutton to the toolbar manually. But I can´t connect it with the switch() function inside the main ViewController.
Thanks for any suggestion!
Select the first responder of the window controller scene, go to the Attributes Inspector and add the action.
Connect the action of the button in the toolbar to the first responder.