This is properly a very simple question, but I'm completly new to IOS dev and Swift.
I'm trying to add a webview and make it fill the entire screen.
This is my code
override func viewDidLoad() {
super.viewDidLoad()
let myWebView:UIWebView = UIWebView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
self.view.addSubview(myWebView)
let url = URL (string: "https://google.com");
let request = URLRequest(url: url! as URL);
myWebView.loadRequest(request);
}
When I run the app only a white screen appear. I can load html as a string (loadHTMLString)
So 2 questions
- How do I get the web view to get fullscreen size?
- Why can't I load a url - I only get the white screen