How to bring NSWindow to front and to the current Space?

后端 未结 6 1671
闹比i
闹比i 2020-12-23 13:26

I\'m using this code to bring up my window:

[self.window makeKeyAndOrderFront:self];
[self.window setOrderedIndex:0];

But often it will be

6条回答
  •  离开以前
    2020-12-23 14:04

    The syntax seems to be a little different with Swift 2:

    NSApplication.sharedApplication().activateIgnoringOtherApps(true)
    

提交回复
热议问题