Skip to content

System Events

levching edited this page Apr 15, 2020 · 2 revisions

Application Did Enter Background

Tellsthe delegate that the app is now in the background. Use this method to release shared resources, invalidate timers, and store enough app state information to restore your app to its current state in case it is terminated later. You should also disable updates to your app’s user interface and avoid using some types of shared system resources (such as the user’s contacts database). It is also imperative that you avoid using OpenGL ES in the background. Your implementation of this method has approximately five seconds to perform any tasks and return.

namespace SA.iOS.UIKit 
...
ISN_UIApplication.ApplicationDelegate.ApplicationDidEnterBackground.AddListener(() => {
    //Do something
});

Application Will Enter Foreground

Tells the delegate that the app is about to enter the foreground. In iOS 4.0 and later, this method is called as part of the transition from the background to the active state. You can use this method to undo many of the changes you made to your app upon entering the background.

namespace SA.iOS.UIKit 
...
ISN_UIApplication.ApplicationDelegate.ApplicationWillEnterForeground.AddListener(() => {
    //Do something
});

Application Did Become Active

Tellsthe delegate that the app has become active. This method is called to let your app know that it moved from the inactive to active state. This can occur because your app was launched by the user or the system. Apps can also return to the active state if the user chooses to ignore an interruption (such as an incoming phone call or SMS message) that sent the app temporarily to the inactive state. You should use this method to restart any tasks that were paused (or not yet started) while the app was inactive. For example, you could use it to restart timers or throttle up OpenGL ES frame rates. If your app was previously in the background, you could also use it to refresh your app’s user interface.

namespace SA.iOS.UIKit 
...
ISN_UIApplication.ApplicationDelegate.ApplicationDidBecomeActive.AddListener(() => {
    //Do something
});

Application Will Resign Active

Tells the delegate that the app is about to become inactive. This method is called to let your app know that it is about to move from the active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the app and it begins the transition to the background state. An app in the inactive state continues to run but does not dispatch incoming events to responders. You should use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. An app in the inactive state should do minimal work while it waits to transition to either the active or background state. If your app has unsaved user data, you can save it here to ensure that it is not lost. However, it is recommended that you save user data at appropriate points throughout the execution of your app, usually in response to specific actions. For example, save data when the user dismisses a data entry screen. Do not rely on specific app state transitions to save all of your app’s critical data.

namespace SA.iOS.UIKit 
...
ISN_UIApplication.ApplicationDelegate.ApplicationWillResignActive.AddListener(() => {
    //Do something
});

Application Did Receive Memory Warning

Tellsthe delegate when the app receives a memory warning from the system. 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. 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.

namespace SA.iOS.UIKit 
...
ISN_UIApplication.ApplicationDelegate.ApplicationDidReceiveMemoryWarning.AddListener(() => {
    //Do something
});

Application Will Terminate

Tellsthe delegate when the app is about to terminate. This method lets your app know that it is about to be terminated and purged from memory entirely. You should use this method to perform any final clean-up tasks for your app, such as freeing shared resources, saving user data, and invalidating timers. Your implementation of this method has approximately five seconds to perform any tasks and return. If the method does not return before time expires, the system may kill the process altogether.

namespace SA.iOS.UIKit 
...
ISN_UIApplication.ApplicationDelegate.ApplicationWillTerminate.AddListener(() => {
    //Do something
});

About

Foundation

AV Foundation

App Tracking Transparency

Game Kit

Store Kit

UI Kit

Social

Replay Kit

Contacts

AVKit

Photos

App Delegate

User Notifications

MediaPlayer

Core Location

AdSupport

EventKit

CloudKit

Authentication Services

XCode

Knowledge Base

Clone this wiki locally