Depending on an XML return, I don’t want the current segue to perform on UIButton touch.
I know I can pick which segue I want to perform, but how to I make a segue not perform? Or at least not perform any of the available segues?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your deployment target is iOS 6.0 or later, you can override the
-[UIViewController shouldPerformSegueWithIdentifier:sender:]method to returnYESif you want to perform the segue andNOif you don’t.If your deployment target is earlier than iOS 6.0, you won’t receive the
shouldPerformSegueWithIdentifier:sender:message. So in your storyboard, don’t draw the segue from the button. Instead, draw the segue from the button’s view controller and give the segue an identifier. Connect the button to anIBActionin its view controller. In the action, check whether you want to perform the segue. If you want to perform it, send yourselfperformSegueWithIdentifier:sender:, passing the identifier you assigned to the segue in the storyboard.