Contents

applicationWillResignActive()

Tells the delegate that the system is about to deactivate the watchOS app.

Declaration

optional func applicationWillResignActive()

Mentioned in

Discussion

WatchKit calls this method after your app launches and before it exits. Use this method to pause any active tasks. For example, you could use it to stop any active timers. An app in the inactive state should do minimal work while it waits to transition to the active or not running state.

If your app has unsaved user data, you can save it here to ensure that it isn’t lost. However, it’s a good idea to save user data at appropriate points throughout the execution of your app, usually in response to user actions. Don’t rely on specific app state transitions to save all of your app’s critical data.

See Also

Monitoring state changes