Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ApolloX

macrumors newbie
Original poster
I'm developing an iOS that for display reasons requires full screen, but I'd still like to have a battery indicator present on screen for the user.

One simple solution is to create a timer that updates the battery indicator on screen every X number of seconds such as:

Code:
[[UIDevice currentDevice] setBatteryMonitoringEnabled:true];
[NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(setBatteryIndicator) userInfo:nil repeats:YES];

Is there a better approach way? Should I be using a notification system to receive notifications every time the battery changes? Anyone have a code snippet that is better than the approach I'm using?
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.