The code below will prevent the iPhone from dimming its screen and ultimately going to sleep. Use it wisely as you don’t want your application becoming notorious for being a battery hog
[UIApplication sharedApplication].idleTimerDisabled = YES; |
Happy iCoding!