how to have nswindow vibrant title bar on swift 3

Discussion in 'Mac Programming' started by abcdefg12345, Nov 3, 2016.

  1. abcdefg12345, Nov 3, 2016
    Last edited by a moderator: Nov 3, 2016

    abcdefg12345 macrumors regular

    abcdefg12345

    Joined:
    Jul 10, 2013
    #1
    I'm trying to have a window full translucent window but my code is not working anyone know where i went wrong

    Code:
    @IBOutlet weak var visualeffect: NSVisualEffectView!
    
        func applicationDidFinishLaunching(_ aNotification: Notification) {
            visualeffect.blendingMode = NSVisualEffectBlendingMode.behindWindow
            visualeffect.material = NSVisualEffectMaterial.dark
            self.window.contentView?.addSubview(visualeffect)
            self.window.styleMask = NSWindowStyleMask.fullSizeContentView
            self.window.appearance = NSAppearance.init(named: NSAppearanceNameVibrantDark)
        }
    
     
  2. KALLT macrumors 601

    Joined:
    Sep 23, 2008

Share This Page