I'm following a tutorial on creating a WKWebView within a view controller and the WKWebView is instantiated with a CGRect value of .zero but the website opens to the entire size of the view controller when I run this code:
import Foundation
import UIKit
import WebKit
class WebViewController: UIViewController{
var webView: WKWebView!
override func loadView() {
let myURL = URL.init(string: "https://www.apple.com")
let webConfiguration = WKWebViewConfiguration()
let myUrlRequest = URLRequest.init(url: myURL!)
webView = WKWebView(frame: .zero, configuration: webConfiguration)
view = webView
webView.load(myUrlRequest)
}
}
Doesn't .zero mean 0 for all values in CGRect?