To my understanding, a WKWebView
cannot be created in a Storyboard. I had to create it programmatically in one of my instances of ViewController with the following code:
override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView.uiDelegate = self
webView.navigationDelegate = self
view = webView
}
The problem I'm facing is I'd like to have a UILabel placed above webView
, that spans the width of the device. Right below it, without any visible space, I'd want the webView
placed. So, if my label is say, 20 pixels in height, the webView would technically be placed 21 pixels lower than where it is now.
In a Storyboard this is obviously a trivial task; how is it done programmatically?