Kasey
Kasey

Reputation: 414

How do I prevent Interface Controller from locking screen? (WatchOS)

I'm trying to make a specific Interface Controller (on my independent Watch App) not go idle.

I've tried this, but ran into the issue that an independent Watch App cannot support UIKit. I've been trying to find a work-around, but haven't found anything yet.

Here's the code I'm trying to get to work:

 UIApplication.shared.isIdleTimerDisabled = true

Upvotes: 0

Views: 862

Answers (1)

Paulw11
Paulw11

Reputation: 114783

No watch app, independent or otherwise, can use UIKit. watchOS apps use WatchKit.

There is no direct equivalent to isIdleTimerDisabled due to the more limited battery life of watches.

If your app is a "self care" or "mindfulness" app then you can use an extended runtime session to remain as the front most app for 10 minutes or 1 hour.

If it is a fitness app then you can use an HKWorkoutSession to be the default front most app when the user raises their wrist during the workout.

Upvotes: 5

Related Questions