Hi, I just updated to macOS Monterey and Xcode 13.1 and the NSButtons on my view not work anymore I tap and nothing work
let visualEffect = NSVisualEffectView() //var theme = NSAppearance(appearanceNamed: NSAppearance.Name.vibrantDark, bundle: nil) visualEffect.translatesAutoresizingMaskIntoConstraints = false visualEffect.blendingMode = .behindWindow visualEffect.state = .active visualEffect.wantsLayer = true visualEffect.layer?.cornerRadius = roundvalueDefault.value(forKey: "roundvaluekey") as! CGFloat visualEffect.layer?.opacity = 0.0 window?.isOpaque = false window?.backgroundColor = .clear //Make window transpraent window?.isMovableByWindowBackground = true checkAlt() //Check if floating //Custom toolbar let customToolbar = NSToolbar() customToolbar.isVisible = true window?.titleVisibility = .hidden window?.styleMask.insert(.fullSizeContentView) window?.titlebarAppearsTransparent = true customToolbar.showsBaselineSeparator = false window?.contentView?.wantsLayer = true window?.toolbar = customToolbar //Change windows radius //Add the blur effcet to the window window?.contentView?.addSubview(visualEffect) guard let constraints = window?.contentView else { return }
visualEffect.leadingAnchor.constraint(equalTo: constraints.leadingAnchor).isActive = true visualEffect.trailingAnchor.constraint(equalTo: constraints.trailingAnchor).isActive = true visualEffect.topAnchor.constraint(equalTo: constraints.topAnchor).isActive = true visualEffect.bottomAnchor.constraint(equalTo: constraints.bottomAnchor).isActive = true }
@IBAction func airplayTapped(_ sender: Any) { print("AAA") }