0

I am loading one web URL in WKWebView. I added network transportation layer and all other suggestion provided in different thread. But Working perfectly fine on Device bot not working on simulator. Please let me know what I am missing ?

 let preferences = WKPreferences()
    preferences.javaScriptEnabled = true
    let webConfiguration = WKWebViewConfiguration()
    webConfiguration.preferences = preferences
    webView = WKWebView(frame: view.bounds, configuration: webConfiguration)


    webView.uiDelegate = self

    webView.navigationDelegate = self
    view.addSubview(webView)

    let request = URLRequest(url: myURL!)
    webView.load(request)
pankaj nigam
  • 381
  • 1
  • 6
  • 9

1 Answers1

0

1.Replace your url to URL(string: "https://contents.tdscpc.gov.in/")

After performing step 1 you will got another error related to SSL secure connection. To resolve it you should add below code in your plist.

  1. Add this in your plist.

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    

I tried it on simulator and it's worked. See result here

shraddha11
  • 783
  • 4
  • 17