Reputation: 1806
I have developed a iPad app and i want that the screen should never sleep or lock. I want the screen to be on when the app runs.
In android there is a screen and wake lock which handles the same, but i was unable to find the same for IOS.
I am guessing it will be some setting in Project or target. Please help.
Upvotes: 3
Views: 1411
Reputation: 12093
You should be able to use
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
You should be able to put this in didFinishLaunchingWithOptions:
method in your AppDelegate.
Upvotes: 7
Reputation: 280
Use the following in your viewDidLoad
//don't lock
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
Upvotes: 4