macOS Zoom Button

How can I disable the Zoom button on linkTexta secondary view using Swift?

Replies

As an application can have multiple windows, the function below will hide the zoom button on all windows, however you can filter out a specific window that you want to target if you choose.

func hideZoomButton() {
    for window in NSApplication.shared.windows {
        if let zoomButton = window.standardWindowButton(NSWindow.ButtonType.zoomButton) {
            zoomButton.isHidden = true
        }
    }
}

You can then call this function from you application delegate on applicationDidFinishLaunching