Separate button action and segue action

I need to click a new segment when I click a button. But I also have an action attached to it that needs to be triggered before the segue is popped.

Can you tell me how to separate them from each other? Any help would be greatly appreciated.

+5
source share
1 answer

Make a segue directly from one view controller to another, instead of connecting it to a button. Give this meaningful name.

Then in the button action method, do all you need to do first, and then do segue using your control method performSegueWithIdentifier:, using the meaningful name that you selected earlier.

, , . , prepareForSegue: segue.destinationViewController, , .

+13

All Articles