Post

Replies

Boosts

Views

Activity

Reply to How to stop the screen from going to sleep
If you write code like that in function and then call the function? private func disableIdleTimer() { #if os(iOS) UIApplication.shared.isIdleTimerDisabled = true #elseif os(macOS) NSApplication.shared.isIdleTimerDisabled = true #endif } private func enableIdleTimer() { #if os(iOS) UIApplication.shared.isIdleTimerDisabled = false #elseif os(macOS) NSApplication.shared.isIdleTimerDisabled = false #endif } }
Nov ’23