3

To monitor battery state and level, app should first enable isBatteryMonitoringEnabled property and set it true.

But why this property created?

You can set it to false or true wherever you want and system does not interfere in monitoring ever.

Is there any advantages in performance to set it false?

rick
  • 1,009
  • 2
  • 10
  • 28
  • I'm not sure how performance wise is it, but if you'll start listening to stuff you don't really need, Apple might not accept your application (the default value is `false` btw) – Daniel Krom May 24 '18 at 07:27
  • 1
    Apple didn't say about rejecting apps that use it and also [documented it](https://developer.apple.com/documentation/uikit/uidevice/1620045-isbatterymonitoringenabled) – rick May 24 '18 at 09:00

1 Answers1

0

I think the OS wants to know what's is your app needs. It affects which apps should be terminated when there isn't enough memory.

yonivav
  • 994
  • 11
  • 18