Skip to content

Instantly share code, notes, and snippets.

@flexaddicted
Created December 8, 2018 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flexaddicted/a061f65832c3fd2f1af39447e18f3269 to your computer and use it in GitHub Desktop.
Save flexaddicted/a061f65832c3fd2f1af39447e18f3269 to your computer and use it in GitHub Desktop.
class ConsumerViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let webViewBox = createWebView(usingModern: true)
// add webView to the view hierachy
webViewBox.load(urlRequest: URLRequest(url: URL(string: "www.google.it")!))
}
private func createWebView(usingModern: Bool) -> WebViewBox {
if usingModern {
return WebViewBox(view: ModernWebView())
}
return WebViewBox(view: LegacyWebView())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment