English subtitles

← Model View Controller - Intro to iOS App Development with Swift

Get Embed Code
3 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. Clearly there's a lot going on here.
  2. But for the sake of simplicity what I want to do
  3. is I want to categorize these ideas into a few buckets.
  4. For instance, ideas like how to add buttons and
  5. how to add text, they're all a very visible part of the app.
  6. Let's call this category, View.
  7. When we are going to build that app, we will also need to save some data.
  8. This, for us, will be audio file that we can play back.
  9. Let's put that in another category and call that category Data or Model.
  10. And finally, we will write some code to control the View and the Model.
  11. Here we will need the change the speed of the recorded audio.
  12. And we will also need to learn how to transition between different screens.
  13. We can call this category controller.
  14. Now a good analogy here would be from the word of theater.
  15. You can think of a View as actors.
  16. Actors are the most visible part of a play.
  17. A Controller is like a director who manages or controls things on a set.
  18. And finally, you can think of the Model as the backstage area,
  19. where they store props that are needed for the play.
  20. So, what you're seeing here,
  21. is the beginning of a design pattern called Model, View, and Controller.
  22. Or MVC for
  23. short, that Apple wants programmers to follow when they are making apps.
  24. In fact, most apps in the app store, follow this sort of a design, and
  25. so will we.
  26. You will begin to see this design pattern as soon as we make our app.
  27. So let's do that next.