I would like to know when a window that is in background becomes the frontmost window.
I read this question but it works to know what window is the frontmost and not when the window becomes the frontmost window: How to know if a NSWindow is the front window?
I implemented this code but unfortunately it is called only when the window is opened not when it comes back to foreground
override func viewDidAppear() {
let a = variables.actionToAddToCurrentWorkflow
if a != "" {
actionItems.append(a)
actionsListTableView.reloadData()
}
}
Being a beginner would appreciate a lot if it was possible to have a sample code as well.