I have created a new Monotouch iOS storyboard project. I have added two screens, one with a button on. I have linked the button to the second screen with a push segue. This all works as expected. What I have now done is add an touch up inside event method to the button, where I am trying to add some logic to say if the segue should be performed or not.
partial void LoginButton_click(UIButton sender)
{
Random r = new Random();
if (r.Next(1,2000000) == 33432)
{
this.PerformSegue("Push", this);
} else {
//Do not perform segue
}
}
I have seen lots of reference online that explain how to use the PerformSegue method, but I can't find how to stop the segue in the storyboard if the logic is not correct. Should I not create a segue in the storyboard and then just do it programatically? This seems to remove a huge benefit of using storyboards though to see how everything fits together.