Post

Replies

Boosts

Views

Activity

Identify front window in document-based Mac app
I have a document-based Mac app using the SwiftUI life-cycle. It works well except that I cannot work out how to tell which window is frontmost. So if I have a menu item that operates on a document, how can I apply it to the document in the frontmost window? Any approach using notifications or passthrough subjects gets applied to all open windows. I think that the focusable modifiers are supposed to deal with this, but they do not appear to work.
0
0
566
Aug ’20