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)
        }
    }
Answered by Claude31 in 631177022
Call NSWorkspace:

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

Accepted Answer
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

Make a link in macOS
 
 
Q