Externally open the url in browser from app iOS swift

 Problem:

I want to open one url from my app to browser.Also validate the url.

How to achieve that?

Solution:

    // MARK: - Open web url

    func openWeb(urlSting:String) {

        if let url = URL(string: urlSting), UIApplication.shared.canOpenURL(url) {

            UIApplication.shared.open(url)

        }

    }

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift