I want to override the screen awake time from my app

Hello, I want to keep my iPhone screen "ON", for particular time interval and I want to control it from my app only.

Is there any way to achieve same in swift?

Eg. I want my app should not go to sleep for 5 mins or 2 mins whatever user decides. And after that interval is over it can go to sleep or can take the iPhone default screen awake time.

You could use isIdleTimerDisabled, to do this.
Set it to true to keep the phone awake, then set it to false to let the system settings take over.

I want to override the screen awake time from my app
 
 
Q