IOS application

UIApplication represents application in IOS. Typically you don't need to make subclass from it.

IOS application can be in one of following states:

  • not running - no code that is being executed and the application is completely switched off.
  • inactive - application is running in the background and is not receiving any events. For example, app can be placed into an inactive state when a call or SMS message is received.
  • active - app is running in the foreground and receiving events.
  • background - app is running in the background, and executing code.
  • suspended - app is in the background, but no code is being executed.

UIApplicationDelegate protocol defines methods that are called by the singleton UIApplication object in response to important events in the lifetime of your app. Here you can handle app states and perform following tasks:

  • initialize your app’s central data structures
  • configuring your app’s scenes
  • responding to notifications originating from outside the app, such as low-memory warnings, download completion notifications, and more.
  • responding to events that target the app itself, and are not specific to your app’s scenes, views, or view controllers
  • registering for any required services at launch time, such as Apple Push Notification service

UIWindowSceneDelegate protocol allows to manage the life cycle of one instance of your app's user interface. XCode generates default SceneDelegate class.