Chapter 7WatchKit Extension Lifecycle
By now your watch app is pretty sophisticated. You’re moving between screens, sending data back and forth, and even replacing your entire UI as needed. But what about all of the other code you want to write—running code when the app starts, handling OS events, and the like? On iOS, you’d use your app delegate to handle the app’s lifecycle methods that run when the user starts or leaves the app. The equivalent on watchOS is the extension delegate, a class you’ll implement to handle the lifecycle events of your watch app. TapALap already has an extension delegate; it was created automatically by Xcode when we created the project, but it doesn’t do anything. In this chapter, you’ll implement TapALap’s extension ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access