I'm creating an app for Mac OSX, (I don't know anything about SwiftUI/Cocoa) this app needs to be hidden when the user presses one button and at a certain time the app should pop-up again.
It's a reminder app:
@IBAction func hidMe(_ sender: NSButton) {
window.close() //I know this will remove the window, but I didn't find another way...
}
//I created this function that was supposed to bring the window to front, but I have no idea how to call it.
func reopen() {
let now = Date()
let components = Calendar.current.dateComponents([.month, .day, .hour, .minute], from: now)
if ((components.hour == 9) && (components.minute == 16)) {
window?.makeKeyAndOrderFront(self)
}