Teaching App Development with Swift

Stopwatch

Level 2, Seven Lessons

Lead students in thinking deeper about models, views, controllers, and users. Teach students how to connect interface elements to controller actions, and how to avoid pitfalls that prevent the interface from staying responsive.

The Finished App

Familiarize yourself with the project, and demonstrate the app students will build.

Lesson 1

Facilitate adding interface elements to the main view, and demonstrate Auto Layout constraints.

Lesson 2

Incorporate a model into the project, using optionals and computed properties. Introduce the NSDate and NSTimeInterval types.

Lesson 3

Demonstrate incorporating the model with the controller, and explain the use of default property values. Explain how interactive interface elements connect to controller actions, use Interface Builder to establish connections, and explore the @IBAction attribute.

Lesson 4

Introduce the Bool datatype with a computed property, and illustrate Run Loops by intentionally blocking interface responsiveness.

Lesson 5

Explain how to use an NSTimer to repeatedly execute methods, and the importance of keeping the app interface responsive.

Lesson 6

Lead students in exploring documentation, and challenge them with explicitly extracting time components from an NSTimeInterval.

Lesson 7

Discuss user experience and accessibility. Analyze the controller to discover code that belongs in a computed property of the model.

The course materials only, and not any other content of this web page, are to be used pursuant to a Creative Commons license, as specified in the license information within the course materials.

Trademark Information

The Swift logo, Apple, the Apple logo and other Apple trademarks, service marks, graphics, and logos used in connection with the Swift Education project are trademarks or registered trademarks of Apple Inc. in the US and/or other countries. Other trademarks, service marks, graphics, and logos used in connection with the Swift Education project may be the trademarks of their respective owners. You are granted no right or license in any of the aforesaid trademarks, and further agree that you shall not remove, obscure, or alter any proprietary notices (including trademark and copyright notices) that may be affixed to or contained within the Service.

For further information about proper referential uses of the Swift logo, please review the “Guidelines for Using Apple Trademarks and Copyrights”.