How do I keep the user's iPhone's display on?

前端 未结 2 883
难免孤独
难免孤独 2021-01-06 04:59

So, I was looking for a way to keep the user\'s iPhone display on for a clock app. I found [UIApplication sharedApplication].idleTimerDisabled = YES; but that k

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-06 05:50

    Alter the idleTimerDisabled property whenever your app changes its active state - if you're going to be backgrounded, re-enable the timer, and when you regain control, disable the timer again.

提交回复
热议问题