Swift Question

How to always show alert of my Cocoa application pop up all other applications?

I create the app simple. the app just remind work. I have problem how to my Alert always show pop up all other app. I tried code but my alert will hide when use other app I want my alert look like this alert in image
I tried code

enter image description here

let myPopup: NSAlert = NSAlert()
myPopup.messageText = "Notification"
myPopup.informativeText = "Hello world"
myPopup.alertStyle = NSAlertStyle.WarningAlertStyle
myPopup.addButtonWithTitle("OK")
myPopup.addButtonWithTitle("Cancel")
myPopup.runModal()


But when I use other app it hide.
I want always show alert.
You can tutorial code example help me ?

I just beginner. I want writer app remind simple. I spent a whole day to do it but i can't. please help me.

Max Max
Answer

You can modify the windowLevel property of your alerts window object. NSModalPanelWindowLevel should give the desired effect.