Created
February 7, 2017 06:47
-
-
Save bakkiraju/bed042bb7f659fd99c748c7a32b835d5 to your computer and use it in GitHub Desktop.
Always on the Top, click through transparent window in Swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
@NSApplicationMain | |
class AppDelegate: NSObject, NSApplicationDelegate { | |
@IBOutlet weak var window: NSWindow! | |
func applicationDidFinishLaunching(_ aNotification: Notification) { | |
self.window!.isOpaque = false; | |
self.window!.alphaValue = 0.7; | |
self.window!.level = Int(CGWindowLevelKey.draggingWindow.rawValue) | |
self.window!.collectionBehavior = NSWindowCollectionBehavior.stationary | |
self.window.ignoresMouseEvents = true | |
} | |
func applicationWillTerminate(_ aNotification: Notification) { | |
// Insert code here to tear down your application | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment