WKWebView not loading webpage - renders blank screen in Swift

后端 未结 5 1880
渐次进展
渐次进展 2020-12-11 00:48

This code is supposed to load the Apple homepage, but instead shows a blank screen.
This happens with both HTTP and HTTPS URLs.

Code:

import UIK         


        
5条回答
  •  余生分开走
    2020-12-11 01:28

    Building an App for the Mac?

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


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

    com.apple.security.app-sandbox
    
    com.apple.security.network.client
    
    

提交回复
热议问题