A manager class is a great way to handle business logic that deals with a specific data model. In this video, learn how to create a simple manager class to handle your Movie model's behavior.
- [Instructor] Now that we have our simple movie data model,…we can move into creating the movie manager class.…And that's going to handle all of our business logic.…Let's go into our test folder and our test models…right click and create a new file.…You want ios selected, unit test case class.…We're going to call this movie manager tests.…Make sure this is in our test models folder and hit create.…Let's get in the habit of adding our testable import…at the top and we'll save that.…
Now our movie manager is only going to be concerned…with keeping track of a few variables.…Mainly the number of movies we want to see.…And the number of movies we've already been to.…Now the tests we're going to write will make sure that these…variables are both set to zero when starting up our app.…So let's delete our default test examples…and start off with one of our own.…Func testInit underscore and here it's going to be…movies to see returns zero.…
Again good test naming is important for your…own sake and any other developers you might be working with.…
- What is test-driven development?
- Creating and expanding a data model
- Creating a manager class
- Testing class methods
- Checking for duplicates
- Testing table views
- Mocking cells
- Testing cell selection
- Assembling the app
Skill Level Intermediate
Advanced iOS Development: Working with APIswith Saul Mora1h 59m Intermediate
Designing iOS and Android Appswith Renata Phillippi1h 6m Intermediate
1. Foundation and Theory
2. Getting Started
3. The Manager Class
4. TableView Testing
5. Finishing Touches
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.