FioriSFSafariViewControllerPresenter
open class FioriSFSafariViewControllerPresenter : NSObject, SFSafariViewControllerPresenting, FlowPresentationDelegateClient
extension FioriSFSafariViewControllerPresenter: SFSafariViewControllerDelegate
The default implementation for the SFSafariViewControllerPresenting. Presents a SFSafariViewController on demand, can be configured to show an info screen before the presentation.
-
Instantiates the web view presenter. By default it has an info screen which is presented during
restore
flow and application running.Declaration
Swift
public init(delegate: WebViewPresenterDelegate? = nil)
Parameters
delegate
The web view presenter delegate to handle presenter events.
-
The delegate which handles the UIViewController presentation.
Declaration
Swift
open var presentationDelegate: FlowPresentationDelegate! { get set }
-
Before the info screen is presented, this handler is called for customization. By default it does nothing.
Declaration
Swift
open var infoScreenConfigurationHandler: (FUIInfoViewController) -> Void { get set }
-
An option set to configure when to present the info screen.
Declaration
Swift
open var infoScreenPresentationOptions: InfoScreenPresentationOptions { get set }
-
The presenter delegate, which handles the webview presenter UIViewController
Declaration
Swift
weak public var delegate: WebViewPresenterDelegate?
-
Presents the web view and passes the instance in the completion handler.
Declaration
Swift
public func presentWebView(with url: URL, completionHandler: @escaping (SFSafariViewController?, Error?) -> Swift.Void)
Parameters
url
The initial url which will be loaded in the web view. Can not change later.
completionHandler
called when the webView is presented. Error filled on failure.
-
Dismisses the presented web view.
Declaration
Swift
public func dismissWebView()
-
Delegate call when the user touches the done button
Declaration
Swift
public func safariViewControllerDidFinish(_ controller: SFSafariViewController)
Parameters
controller
SFSafariViewController to dismiss