|
have tried this:
NOPE
and I am importing UIKit why? |
|
This is basically because UIApplication does not exist on watchOS: https://developer.apple.com/documentation/uikit/uiapplication I'm not familiar with watchOS development, but if you describe what you want to achieve, perhaps somebody knows what's available on watchOS to do the same thing. |
|
On WatchOS you need specific background modes enabled to prevent your app going to sleep. Or do you just mean that the screen shouldn't go black? |
|
@Hatsushira, I just want the screen not to go black. When it does, the app goes to inactive. I want the app to continue active and running, as it does when I am debugging on the simulator. I can detect the app going to inactive, as the screen goes black by using this
|
|
I doubt this is possible if you don't use the special background sessions. But they're restricted to special use cases. With these the screen goes black anyway but the app still runs. I created a workout app for me and that was the way to go. |
|
|
|
|
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.