OSX Swift open URL in default browser

前端 未结 8 1315
情话喂你
情话喂你 2020-12-04 14:10

How to open a url in system default browser by using Swift as programming language and OSX as plattform.

I found a lot with UIApplication like

UIAppl         


        
8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 14:50

    MacOS Xcode 10 Swift 4.2 update

    NSWorkspace.shared.open(URL(string: "https://www.google.com")!)
    

提交回复
热议问题