iOSLibHTMLViewer - UBogun/Xojo-iosLib GitHub Wiki

Native class: AppleWebView
Inherits from: iOSLibCanvas

iOSLibHTMLViewer is the custom control of iOSLib containing an AppleWebView as object, which means it is a replacement for Xojo’s iOSHTMLViewer. You will only need to use this custom control if you want to handle the events returned by this class; every other feature is available for Xojo iOSHTMLViewer transparently via the iOSLibHTMLViewerExtension.

Like all iOSLib custom controls, the control is a wrapper that contains the view and performs translations between Xojo and iOS classes / data types transparently whereever possible.
Like all iOSLib custom controls, if you want to attain maximum performance, you can always address the iOSClass itself via the Controls ID object. The ID object is always the View subclass itself, in this case AppleWebView. The iOS class expects Apple native objects and data types of course. You can always use the included translation methods to bridge from Xojo types and classes to iOS.

General information

AppleWebView

Inspector Properties

Inspector properties
Inspector behavior properties of iOSLibHTMLViewer

Properties

AllowAirPlay As Boolean: If True, can stream to AirPlay.

AllowInlineMediaPlayback As Boolean: If true, can play embedded videos.

AllowLinkPreview As Boolean: Whether pressing on a link displays a preview of the destination for the link. Available since iOS 9.0 on 3D Touch devices.

AllowPictureInPicturePlayback As Boolean: Whether Picture in Picture playback is allowed from this view. Available since iOS 9.0.

CanGoBack As Boolean (read-only): True if the user can return to a previously visited site.

CanGoForward As Boolean (read-only): True if you can use the GoForward method.

ID As AppleWebView: Lets you address the AppleWebView / UIWebView instance of the HTLViewer for full access to its features.

IsLoading As Boolean (read-only): True if the Viewer is currently loading data.

PlayMediaAutomatically As Boolean: If True, starts videos without user interaction.

ScalesPageToFit As Boolean: If True, displayed content is scaled and user zoom is enabled.

SuppressRenderDuringLoad As Boolean: If true, will not render content while it is being loaded.

Methods

GoBack(): Goes to the site visited previously.

GoForward(): If GoBack was used before, lets you return to the previously watched content.

Reload(): Reloads the current content.

RunJavaScript (AScript As Text) A Text: Runs a Javascript ≤ 10 MB and returns its result.

StopLoading(): Does exactly that.

Events

LoadFailed(Error As Integer, Reason As Text): Loading web content failed. Gives you error number and localized reason.

LoadFinished(): The control has loaded content successfully.

LoadStarted(): The control started loading web content.

SuppressLoad (URLPath as text, NavigationType As AppleWebView.UIWebViewNavigationType) As Boolean: Fires before the control starts to process a URLRequest. Return true to suppress fulfilling it.