Wednesday, 22 January 2020

WKWebView Alert crash on iOS 13 SceneDelegate

*** Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'UIAlertView is deprecated and unavailable for UIScene based applications, please use UIAlertController!'

On alert from WKWebView it throws above error.

UIAlertView is called from Javascript in Webpage. I'm not calling UIAlertView manually.

import UIKit
import WebKit

class ViewController: UIViewController{

    @IBOutlet weak var webView: WKWebView!
    override func viewDidLoad() {
        super.viewDidLoad()

        let url = URL(string: "https://www.google.com/maps")!
        webView.load(URLRequest(url: url))
    }
}

After maps are loaded when I click on "Your Location", app crashes.



from WKWebView Alert crash on iOS 13 SceneDelegate

No comments:

Post a Comment