The Uidevice class provides a singleton object that represents the device through which information about the device can be obtained, such as battery level (batterylevel), battery status (batterystate), type of device (model, such as ipod, iphone, etc.). ), the system of the device (systemversion)
Uidevice Features:
(1) This singleton object can be obtained by [Uidevice Currentdevice]
(2) The Uidevice object publishes a number of notifications without interruption, and the following is the name constant of the notification published by the Uidevice object:
Uideviceorientationdidchangenotification//Device rotation
Uidevicebatterystatedidchangenotification//Battery status change
Uidevicebatteryleveldidchangenotification//battery charge change
Uideviceproximitystatedidchangenotification//proximity sensors (e.g., the device is close to the user's face)
7 , notification, and proxy selection
Common:
Communication between objects can be accomplished with notifications and proxies
(e.g. a object tells the D object what's going on, a object passes data to the D object)
Different points:
Agent: One-to-two relationships (an object can only tell what happened to another 1 objects)
Notification: A Many-to-many relationship (an object can tell what happened to n objects, and 1 objects know what happened to n objects).
Uidevice Notifications for iOS development