iT邦幫忙

2017 iT 邦幫忙鐵人賽
DAY 23
0
自我挑戰組

iOS 筆記系列 第 23

UIApplication 是什麼?

  • 分享至 

  • xImage
  •  

官方文件

The UIApplication class provides a centralized point of control and coordination for apps running in iOS. Every 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 shared() class method.

簡單中文解釋:UIApplication class 提供一個中央管理統合 app 的東西,當 App 啟動(launche)時,系統會呼叫一個方法,在其他相關的方法會創造一個 Singleton UIApplication 物件。

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.

簡單中文解釋:application 物件主要在負責處理 user event 初始 routing 的工作,它要覺得要把這個 message 傳給誰


上一篇
Advanced Notifications WWDC 16 Session 708
下一篇
UIWindow 是什麼?
系列文
iOS 筆記30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言