1

I am trying to make a borderless Window with NSVisualEffectView as view like this:

class AppDelegate: NSObject, NSApplicationDelegate {
    
    private lazy var window: NSWindow = NSWindow()
    
    func applicationDidFinishLaunching(_ aNotification: Notification) {
        
        window.styleMask = [.borderless]
        window.backingType = .buffered

        let blurView: NSVisualEffectView = NSVisualEffectView()
        blurView.wantsLayer = true
        blurView.blendingMode = .behindWindow
        blurView.material = .popover
        blurView.layer?.cornerRadius = 50
        blurView.state = .active
        
        window.contentView = blurView
        window.setContentSize(CGSize(width: 250, height: 250))
        window.backgroundColor = .clear
        
        window.setFrameAutosaveName("Main Window")
        window.isMovableByWindowBackground = true
        
        window.makeKeyAndOrderFront(window)
    }
}

The issue is that there is a border being creating because of NSVisualEffectView and I do not need it. How can I remove that?

enter image description here

HangarRash
  • 7,314
  • 5
  • 5
  • 32
ios coder
  • 1
  • 4
  • 31
  • 91

0 Answers0