Uidevice Notifications for iOS development

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.