UIWebView doesn't display images on iOS9, and SafariViewController doesn't upload HTML files at all?

I just discovered that a UIWebView that loads an HTML line with embedded images doesn't work correctly to show an image on iOS9 (GM seeds) that worked correctly before iOS8 .

After watching the WWDC video, SafariViewController here also thought that Apple wants us to turn to a new structure that looks pretty promising. But the problem is that SafariViewController does not support loading local HTML files and only supports HTTP and HTTPS, so far on iOS9 the seeds of GM and Xcode 7.1 beta. I tried loading it using NSURL pointing to a local file, an exception was thrown:

"NSInvalidArgumentException", reason: "The specified URL has an unsupported scheme. Only HTTP and HTTPS URLs are supported.

Does anyone see the same issue with UIWebView on iOS9 and any walkaround? Thanks.

About the SafariViewController problem, I pinged Ricky at Apple about this and submitted a request for a function, I hope that this will be considered in the near future.

+4
source share
1 answer

You should be able to use UIWebView and disable application transport protection by setting the following in your plist file:

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

See this answer for more help.

+14
source

Source: https://habr.com/ru/post/1607386/


All Articles