I Found out the answer I was looking for and thought this might be useful for other people look for something similar. Heres my code :
import Cocoa
class window: NSWindowController {
override func windowDidLoad() {
super.windowDidLoad()
let view = NSVisualEffectView(frame: NSRect(x: 0, y: 0, width: 1500, height: 800))
view.blendingMode = NSVisualEffectBlendingMode.BehindWindow
view.material = NSVisualEffectMaterial.Dark
view.state = NSVisualEffectState.Active
self.window!.contentView!.addSubview(view)
}
}
I made a NSWindowController class and added the code above to it. Then connected the class to the window controller in my main.storyboard.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.