Every iOS app has exactly one instance of UIApplication (or, very rarely, a subclass of UIApplication). When an app is launched, the system calls the UIApplicationMain function; among its other tasks, this function creates a Singleton UIApplication object. Thereafter you access the object by calling the sharedApplication class method.
A major role of your app’s application object is to handle the initial routing of incoming user events. It dispatches action messages forwarded to it by control objects (instances of the UIControl class) to appropriate target objects. The application object maintains a list of open windows (UIWindow objects) and through those can retrieve any of the app’s UIView objects.
The UIApplication class defines a delegate that conforms to the UIApplicationDelegate protocol and must implement some of the protocol’s methods. The application object informs the delegate of significant runtime events—for example, app launch, low-memory warnings, and app termination—giving it an opportunity to respond appropriately.
Apps can cooperatively handle a resource, such as an email or an image file, through the openURL: method. For example, an app that calls this method with an email URL causes the Mail app to launch and display the message.
Most apps do not need to subclass UIApplication. Instead, use an app delegate to manage interactions between the system and the app.
If your app must handle incoming events before the system does—a very rare situation—you can implement a custom event or action dispatching mechanism. To do this, subclass UIApplication and override the sendEvent: and/or the sendAction:to:from:forEvent: methods. For every event you intercept, dispatch it back to the system by calling [super sendEvent:event] after you handle the event. Intercepting events is only rarely required and you should avoid it if possible.
Returns the singleton app instance.
The delegate of the app object.
The runtime state of the app.
Specifies the minimum amount of time that must elapse between background fetch operations.
The smallest fetch interval supported by the system.
A fetch interval large enough to prevent fetch operations from occurring.
The minimum amount of time (measured in seconds) an app may run a critical background task in the background.
Attempts to open the resource at the specified URL asynchronously.
Returns a Boolean value indicating whether an app is available to handle a URL scheme.
Options for opening a URL.
Used to create a URL that you can pass to the openURL: method. When you open the URL built from this string, the system launches the Settings app and displays the app’s custom settings, if it has any.
A Boolean value that controls whether the idle timer is disabled for the app.
Tells the app that your code is restoring state asynchronously.
Tells the app that your code has finished any asynchronous state restoration.
Prevents the app from using the recent snapshot image during the next launch cycle.
Registers a custom object for use with the state restoration system.
The Home screen dynamic quick actions for your app; available on devices that support 3D Touch.
Tells the app to begin receiving remote-control events.
Tells the app to stop receiving remote-control events.
The app's visible and hidden windows.
Returns the default set of interface orientations to use for the view controllers in the specified window.
The animation duration in seconds for the status bar during a 90 degree orientation change.
The style of the device’s status bar.
The animation applied to the status bar as it is hidden or made visible.
Keys used to access values in the userInfo dictionary of some UIApplication-posted notifications.
Key identifying the new content size category.
Constants that identify extension points you want to disallow in your app.
Mode while tracking in controls is taking place.
All UIApplication notifications are posted by the app instance returned by sharedApplication.