Here is the simple code that works in xcode 8 but does not work(blank screen) on Xcode 9. Tried changing App Transport settings - Allow Arbitary loads to “YES”. Still not working.
Any suggestions on how to fix this?
import UIKit
import WebKit
class ViewController: UIViewController {
@IBOutlet weak var webview: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
webview.loadHTMLString(“Hello HTML String”, baseURL: nil)
}
}
@nhr Thanks very much for your question. Have you tried loading a webpage inside the URL? Try that first, and see if you can load a page like www.google.com.
@IBOutlet weak var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let url = NSURL (string: "https://www.google.com");
let request = NSURLRequest(URL: url!);
webView.loadRequest(request);
}
This works fine on storyboard created using Xcode 8. But if you create the storyboard using Xcode 9, I still get a blank screen. See if you test this on a storyboard created using Xcode 9.