From the course: Swift: Delegations and Data Sources
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Controller
- [Narrator] The view and the model don't talk to each other. The heart of the model view controller, connects these two so they do. Called the controller, it coordinates what happens in the model and what happens in the view. Go ahead and stop the app. Close up the live view for the moment. And you'll notice something about my code here. This view I kept out of a class. You can make classes of UI View, but they're a bit complicated. Most of the subclasses of UI View, we use regularly already made for us. For example, UI Button. Now, controllers have identifiers for both the view and the controller. We can make this for example, appear just below my colors. So let's use this, 'cause I'm going to make another class. And I'm going to call it View Controller. Like that. Now, it's going to contain two properties. Or two variables, really. One is colors, which would be my colors. And one would be my view. Like that. Now I have variables for both of these in one class, and that would be my…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.