Separate Button action and segue action

可紊 提交于 2019-12-03 07:56:38

Make the segue directly from one view controller to the other instead of connecting it to the button. Give it a meaningful name.

Then, in your button's action method, perform whatever you need to do first, then perform the segue using your view controller's performSegueWithIdentifier: method, using the meaningful name you chose earlier.

From your comments, it seems like you're trying to set properties on the view controller that is about to appear from your segue. If this is the case, you should implement prepareForSegue:, and use segue.destinationViewController to get a pointer to the view controller that is about to appear.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!