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.

Connect outlets and actions without the Assistant Editor

Connect outlets and actions without the Assistant Editor

From the course: iOS Development Tips

Connect outlets and actions without the Assistant Editor

- [Instructor] If you use the Assistant Editor to connect your storyboards, you've probably had situations with crowded screens like this one in the exercise files. Let me show you another way that makes this a lot easier and cleaner. A less crowded and more powerful way to do this is to code your outlets and actions first and then connect in the storyboard, so I'm going to close all this up and I'm going to head over to View Controller and you'll see here that I have some outlets and actions already made. If you haven't looked closely at these before, let's do them now, let's start with the outlets. An outlet starts with an IBOutlet, it must be weak to prevent memory leaks and since it is weak, you declare it as a variable that is optional and you use whatever kind of object you're going to be making. So in this case, for a label, I'd use a UILabel and I'm doing it as an option. So we can add one more for practice just to show you how this works, is I put an IBOutlet, weak var…

Contents