I'm having difficulty determining how to keep an application minimized when it's running and it displays an NSAlert.
The short of it is that I have an application that is transferring data, and it displays an NSAlert when it finishes the transfer. If the app is minimized, I want it to remain that way even though it displays the NSAlert.
I call the NSAlert with (in Swift):
alert.beginSheetModalForWindow(self, completionHandler: handler)
But the window unminimizes itself when this code fires. If the window is already not minimized, it doesn't grab focus or do anything unexpected (which is the way I want it).
Is there a way to accomplish this? Thanks!