Make a link in macOS

How to make a link when I click to a button in macOS?

This works well in iOS. How to do the same with macOS:

    @IBAction func button1(_ sender: UIButton) {
        if let url = URL(string: "some link") {
            UIApplication.shared.open(url)
        }
    }

Accepted Reply

Call NSWorkspace:

Code Block
if let url = URL(string: "https://www.apple.com/fr/") {
NSWorkspace.shared.open(url)
}

Replies

Call NSWorkspace:

Code Block
if let url = URL(string: "https://www.apple.com/fr/") {
NSWorkspace.shared.open(url)
}

How do we do this for a label? I've been searching high and low for a solution and I can't find anything that is clear enough