Instance Method

applicationDidReceiveMemoryWarning(_:)

Tells the delegate when the app receives a memory warning from the system.

Declaration

optional func applicationDidReceiveMemoryWarning(_ application: UIApplication)

Parameters

application

Your singleton app object.

Discussion

Your implementation of this method should free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later. You use this method in conjunction with the didReceiveMemoryWarning() of the UIViewController class and the UIApplicationDidReceiveMemoryWarning notification to release memory throughout your app.

It is strongly recommended that you implement this method. If your app does not release enough memory during low-memory conditions, the system may terminate it outright.

See Also

Responding to App State Changes and System Events

func application(UIApplication, willFinishLaunchingWithOptions: [UIApplicationLaunchOptionsKey : Any]? = nil)

Tells the delegate that the launch process has begun but that state restoration has not yet occurred.

func application(UIApplication, didFinishLaunchingWithOptions: [UIApplicationLaunchOptionsKey : Any]? = nil)

Tells the delegate that the launch process is almost done and the app is almost ready to run.

func applicationDidFinishLaunching(UIApplication)

Tells the delegate when the app has finished launching. Don’t use. Instead, use application(_:didFinishLaunchingWithOptions:).

func applicationDidBecomeActive(UIApplication)

Tells the delegate that the app has become active.

func applicationWillResignActive(UIApplication)

Tells the delegate that the app is about to become inactive.

func applicationDidEnterBackground(UIApplication)

Tells the delegate that the app is now in the background.

func applicationWillEnterForeground(UIApplication)

Tells the delegate that the app is about to enter the foreground.

func applicationWillTerminate(UIApplication)

Tells the delegate when the app is about to terminate.

func applicationProtectedDataWillBecomeUnavailable(UIApplication)

Tells the delegate that the protected files are about to become unavailable.

func applicationProtectedDataDidBecomeAvailable(UIApplication)

Tells the delegate that protected files are available now.

func applicationSignificantTimeChange(UIApplication)

Tells the delegate when there is a significant change in the time.