static let NSProcessInfoPowerStateDidChange : NSNotification.Name
func addObserver (Any, selector: Selector, name: NSNotification.Name?, object: Any?)
class NotificationCenter
Availability 有効性
Technology
var isLowPowerModeEnabled: Bool
{ get }
Users who wish to prolong their device’s battery life can enable Low Power Mode under Settings > Battery. In Low Power Mode, the system conserves battery life by enacting certain energy-saving measures, such as:
Reducing CPU and GPU performance.
Reducing screen brightness.
Pausing discretionary and background activities.
Your app can query the is
property at any time to determine whether Low Power Mode is active.
Your app can also register to receive notifications when the Low Power Mode state of a device changes. To register for power state notifications, send the message add
to the default notification center of your app (an instance of Notification
). Pass it a selector to call and a notification name of NSProcess
.
電力状態通知に対して登録するには、メッセージadd
あなたのアプリの省略時の通知センター(Notification
のあるインスタンス)に送ってください。それに呼び出しへのセレクタとNSProcess
の通知名を渡してください。
When your app receives a notification of a power state change, query is
to determine the current power state. If Low Power Mode is active, take appropriate steps to reduce activity in your app. Otherwise, your app can resume normal operations.
For additional information, see React to Low Power Mode on iPhones in Energy Efficiency Guide for iOS Apps. 追加情報として、React to Low Power Mode on iPhonesをEnergy Efficiency Guide for iOS Appsで見てください。
static let NSProcessInfoPowerStateDidChange : NSNotification.Name
func addObserver (Any, selector: Selector, name: NSNotification.Name?, object: Any?)
class NotificationCenter