Instance Property インスタンスプロパティ

isLowPowerModeEnabled

A Boolean value that indicates the current state of Low Power Mode.

Declaration 宣言

var isLowPowerModeEnabled: Bool { get }

Discussion 議論

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 isLowPowerModeEnabled 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 addObserver(_:selector:name:object:) to the default notification center of your app (an instance of NotificationCenter). Pass it a selector to call and a notification name of NSProcessInfoPowerStateDidChange. 電力状態通知に対して登録するには、メッセージaddObserver(_:selector:name:object:)あなたのアプリの省略時の通知センター(NotificationCenterのあるインスタンス)に送ってください。それに呼び出しへのセレクタとNSProcessInfoPowerStateDidChangeの通知名を渡してください。 When your app receives a notification of a power state change, query isLowPowerModeEnabled 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 iPhonesEnergy Efficiency Guide for iOS Appsで見てください。

See Also 参照

Related Documentation 関連文書