OSX Swift open URL in default browser

前端 未结 8 1277
情话喂你
情话喂你 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

    xCode 9 update

    let url = URL(string: "https://www.google.com")!
    
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
    

提交回复
热议问题