Loading webpage inside iOS application

ios, safari, xcode

Solution

If you want some browser type functionality for devices earlier then iOS7, you can use this inline browser

iOS 9 Update: Apple has introduced a visible standard interface for browsing the web i.e. SFSafariViewController for iOS 9+ devices.

Example:

func showTutorial() {
    if let url = URL(string: "https://www.example.com") {
        let config = SFSafariViewController.Configuration()
        config.entersReaderIfAvailable = true

        let vc = SFSafariViewController(url: url, configuration: config)
        present(vc, animated: true)
    }
}

Problem

If we load a webpage, we can forward it to safari, but this causes users to leave our app. Is there any way so that a user visits any webpage and then come back to our application.

Original source