UIApplication and its Delegate


1. UIApplication :  root class UIResponder

  • A major role of your app’s application object is to handle the initial routing of incoming user events
  • he 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.

Some Other Task

2. UIApplicationDelegate : root class NSObjectProtocol

The UIApplicationDelegate protocol defines methods that are called by the singleton UIApplication object in response to important events in the lifetime of your app.

The app delegate performs several crucial roles:

  • It contains your app’s startup code.
  • It responds to key changes in the state of your app. Specifically, it responds to both temporary interruptions and to changes in the execution state of your app, such as when your app transitions from the foreground to the background.
  • It responds to notifications originating from outside the app, such as remote notifications (also known as push notifications), low-memory warnings, download completion notifications, and more.
  • It determines whether state preservation and restoration should occur and assists in the preservation and restoration process as needed.
  • It responds to events that target the app itself and are not specific to your app’s views or view controllers.
  • You can use it to store your app’s central data objects or any content that does not have an owning view controller.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s