Created
December 8, 2018 16:19
-
-
Save flexaddicted/c6b14d338ba0c85bb2063947d735ff0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConsumerViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let webView = createWebView(usingModern: true) | |
// add webView to the view hierachy | |
if let urlRequestable = webView as? URLRequestable { | |
urlRequestable.load(urlRequest: URLRequest(url: URL(string: "www.google.it")!)) | |
} | |
} | |
private func createWebView(usingModern: Bool) -> UIView { | |
if usingModern { | |
return ModernWebView() | |
} | |
return LegacyWebView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment