iOSHTMLViewer

From Xojo Documentation

Class (inherits from iOSControl)

A scrollable HTML viewer control.

Events
Close Open
Properties
AccessibilityHint Left fa-lock-32.png Top fa-lock-32.png
AccessibilityLabel Name fa-lock-32.png Visible
Height fa-lock-32.png Parent fa-lock-32.png Width fa-lock-32.png
Methods
AddConstraint Handle RemoveControl
AddControl Invalidate SetTintColor
Control LoadURL
ControlCount RemoveConstraint

Notes

App Transport Security

Starting with iOS 9, you have to use secure "https" connections or the page will not display. To continue to connect to non-secure "http" connections that you do not control you'll have to provide a plist with a temporary exception specified for each site you are accessing via http:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>firstsite.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
            <key>secondsite.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>
</dict>
</plist>

If you don't know the specific sites, you can request access to everything using a single key:

<key>NSAppTransportSecurity</key>
<dict>
  <!-- Include to allow all connections; avoid if possible -->
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>

Apple may reject your App Store submission if you app uses these settings without valid reasons.

For more information about this, refer to NSAppTransportSecurity in Apple's docs.

fa-exclamation-circle-32.png
Apparently there is a bug in iOS that prevents the use of IP addresses in this plist. So to enable http on your local computer for testing use "localhost" rather than "127.0.0.1" and be sure to use "http://localhost" in your URLs instead of "http://127.0.0.1".

See Also

Xojo.Net.HTTPSocket