Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在swift中加载localhost_Swift_Uiwebview - Fatal编程技术网

如何在swift中加载localhost

如何在swift中加载localhost,swift,uiwebview,Swift,Uiwebview,伙计们,我已经创建了一个基于网络视图的ios应用程序。在启动之前,我必须测试它,但我无法在测试应用程序中加载我的本地主机 我试过这种方法 <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>192.168.0.189</key> <st

伙计们,我已经创建了一个基于网络视图的ios应用程序。在启动之前,我必须测试它,但我无法在测试应用程序中加载我的本地主机

我试过这种方法

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>192.168.0.189</key>
        <string></string>
        <key>ExceptionAllowsInsecureHTTPLoads</key>
        <true/>
        <key>localhost:port</key>
        <string></string>
    </dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
NSAppTransportSecurity
NSExceptionDomains
192.168.0.189
例外低安全Http负载
本地主机:端口
NSAllowsArbitraryLoads
还有其他方法吗?

试试这个

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>192.168.0.189</key>
        <dict>
        <key>NSIncludesSubdomains</key>
        <true/>
        <key>NSExceptionAllowsInsecureHTTPLoads</key>
        <true/>
        <key>NSExceptionRequiresForwardSecrecy</key>
        <true/>
        <key>NSExceptionMinimumTLSVersion</key>
        <string>TLSv1.2</string>
        <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
        <false/>
        <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
        <true/>
        <key>NSThirdPartyExceptionMinimumTLSVersion</key>
        <string>TLSv1.2</string>
        <key>NSRequiresCertificateTransparency</key>
        <false/>
    </dict>
    </dict>
</dict>
NSAppTransportSecurity
NSAllowsArbitraryLoads
NSExceptionDomains
192.168.0.189
n包括多个域
N异常低安全Http负载
NSExceptionRequiresForwardSecretary
NSExceptionMinimumTLSVersion
TLSv1.2
N第三方异常低安全Http负载
N第三方例外要求转发保密
第三方例外最小版本
TLSv1.2
NSRequiresCertificateTransparency

@StephenBalaji嗯,我编辑了我的答案。不确定你已经试过了,但如果你不试过这个。我希望它能起作用!它仍然显示白色屏幕。。如果还有别的办法,请告诉我。。感谢您的回复@User18474728