I have created a project in Xcode using storyboards. I created a segue between two of the view controllers with a button using the click and drag method. However, there are a certain set of conditions that I want to be met in order for the segue to happen. So I already coded the button as an IB action and wrote the conditional code in the implementation file. If the conditions are not met, an alert view pops up, and I don’t want the segue to happen. But if the conditions are met then I do want the segue to happen.
Is there any way to programmatically command a segue to happen or not happen inside an IB action function? Or any other way to get the same kind of result?
THANKS! Any help is appreciated!
I found a great solution for this that someone posted… create a segue that originates from from the status bar of the originating view controller, give it an identifier, and then add this code inside the action button:
Works great!