I'm trying to disable the sleep timer when a button is pressed in my macOS app but the problem is that from the resources I've seen elsewhere the code doesn't work.
The code I'm trying is
UIApplication.shared.isIdleTimerDisabled = true
When I try and run my app I get this error
Cannot find 'UIApplication' in scope
From what I've managed to search for regarding this it appears that UIApplication might be an iOS thing, but how can I adapt this for macOS? I've found some code samples from 5+ years ago but it involves lots of code. Surely, in 2025 macOS can disable sleep mode as easy as iOS, right?
How can I achieve this please?