I've just approached Swift, for building a quick utility app for my MacBook. I have written the following code, but it gives me the error "Cannot find 'UIScreen' in scope".
class AppDelegate: NSObject,NSApplicationDelegate{
//...
func applicationDidFinishLaunching(_ notification: Notification) {
Timer.scheduledTimer(withTimeInterval: 10, repeats: true) { timer in
UIScreen.mainScreen().brightness = CGFloat(0.0) //<- error here
}
}
//...
}
Initially I thought I've missed an import, but I cannot find what to import (UIKit, is only for iOS). Thank you for any help