Module Outline

Use the following resources and work with your mentor to master the objectives for this module. Practice by completing the Mini-Project, Project, and Challenges.

Objectives

Lesson Video

Preclass Videos

Video Challenges

  • EditingStyle

    Create a UITableView that allows you to delete and reorder UITableViewCells. Give a custom section header view and multiple sections. Use an enum and a switch statement to distinguish between sections.

    As a black diamond, create a custom UITableViewCell with a UITextField that uses a custom delegate to tell the Datasource or ViewController that the text has changed within the UITextField.

Stretch Problem

    Custom Properties

    PART 1

    1. Make a constant called currentYear that is an integer equal to the current year (e.g. 2016).
    2. Create a Person struct with properties for first name as a String, last name as a String, and year of birth as an Int.
    3. Create an instance of the Person struct
    4. Print out the instance's birth year
    5. Print out its first and last name

    PART 2

    1. Add a computed property for age to the Person struct
    2. Implement a getter for age. The getter should calculate and return the person's age based on the current year and the person's year of birth. (Hint: Look up getters in the Swift programming guide or in documentation).
    3. Implement a setter for age. The setter should update the year of birth based on the age and current year. (Hint: look up setters).
    4. Print out the person's age
    5. Update their age and then print their new year of birth.

    ♦ Black Diamond

    Change your currentYear constant so that instead of being a hard-coded, static year, it uses NSDateComponents to get the actual current year anytime it runs. Documentation should help you out.

  • Hint
  • Solution

Guided Project

    Settings

    Settings is a project designed to help students practice working with intermediate table view concepts, creating protocols, and implementing MVC patterns.

Project

  • Alarm Part One

    Students will build a simple alarm app to practice intermediate table view features, protocols, the delegate pattern, NSCoding, UILocalNotifications, and UIAlertControllers.

    ReadMe

Mastery Review

Module 11 - Delegate Pattern, Intermediate Tableviews
  • Expand all
  • Collapse all
  • Custom Properties stretch problem
  • Challenges
    • EditingStyle objective challenge
  • Settings guided project