From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Segue Actions

Segue Actions

- [Instructor] If you've been working with view controllers for a while, you've probably dealt with Prepare for Segue. In Xcode 11, there's a new way to handle this that makes a little more sense in segue actions. Let's take a look at this feature. If you download the storyboard, you'll find I've set you up a project that's just a button. We're going to make it increment the label that's over here through a segue. Now here's a segue already set up, and I'm going to delete that segue so we can make a new one. And I'm just going to do a control drag here, and we'll just pick a show action segue. Now I'm going to click on the segue, 'cause I'm going to select that. And open the assistant editor and control drag from the segue into the code like I would do for an action or a button. And I get something called a segue action, which does much of what Prepare for Segue does without some of the overhead. So I'm going to name…

Contents