How to make Segue Pass Data AND ONLY execute if certain criteria is met

后端 未结 2 548
不知归路
不知归路 2021-01-27 03:04

I have a Login page with a button. When I click on it, IF and ONLY IF the login was successful, I want to pass data to another class (using properties).

I have tried usi

相关标签:
2条回答
  • 2021-01-27 03:37

    Once prepareForSegue:sender: has been called, you can't stop the segue from happening.

    You should check for the criteria and call the performSegueWithIdentifier method conditionally.

    0 讨论(0)
  • 2021-01-27 03:41

    You connect the segue from the controller (not a button), and then after your condition is met, call performSegueWithIdentifier in code.

    0 讨论(0)
提交回复
热议问题