WKWebView is not loading url

Mac App Devs

If you are building an app for the Mac, make sure to turn App Sandbox ON in your target and tick Networks Incoming/Outgoing Connections.

enter image description here


Update: If you prefer the long way, add the following to YourAppName.entitlements

<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>

First check did you set the permission in the info.plist file ? If not then you just need to take permission of TransportSecurit to YES in info.plist file

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

Like below

enter image description here