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

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift