PSPDFWebViewController

Objective-C


@interface PSPDFWebViewController
    : PSPDFBaseViewController <PSPDFStyleable, PSPDFOverridable>

Swift

class WebViewController : PDFBaseViewController, Styleable, Overridable

Inline Web Browser.

  • Use this to get a UINavigationController with a done-button.

    This always creates an instance of WebViewController as the child of the navigation controller, even if called on a subclass of WebViewController.

    Declaration

    Objective-C

    + (nonnull UINavigationController *)modalWebViewWithURL:(nonnull NSURL *)URL;

    Swift

    class func modalWebView(with URL: URL) -> UINavigationController
  • Creates a new PSPDFWebViewController with the specified custom URL request.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithURLRequest:(nonnull NSURLRequest *)request;

    Swift

    init(urlRequest request: URLRequest)
  • Creates a new PSPDFWebViewController with the specified URL.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithURL:(nonnull NSURL *)URL;

    Swift

    init(url URL: URL)
  • Controls the available actions under the more icon. Defaults to all actions except .stopReload on iPad and all actions on iPhone (but with conditionally visible toolbars).

    Declaration

    Objective-C

    @property (nonatomic) PSPDFWebViewControllerAvailableActions availableActions;

    Swift

    var availableActions: WebViewControllerAvailableActions { get set }
  • Associated delegate, connects to the PDFViewController.

    Declaration

    Objective-C

    @property (nonatomic, weak) id<PSPDFWebViewControllerDelegate> _Nullable delegate;

    Swift

    @IBOutlet weak var delegate: WebViewControllerDelegate? { get set }
  • Accesses the WKWebView directly.

    Declaration

    Objective-C

    @property (nonatomic, readonly) WKWebView *_Nonnull webView;

    Swift

    var webView: WKWebView { get }
  • If enabled, shows a progress indicator much like Safari. Defaults to YES. Set this before the view is loaded.

    Declaration

    Objective-C

    @property (nonatomic) BOOL showProgressIndicator;

    Swift

    var showProgressIndicator: Bool { get set }
  • If set to YES, a custom HTML is loaded when the WKWebView encounters an error (like 404). Defaults to YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL useCustomErrorPage;

    Swift

    var useCustomErrorPage: Bool { get set }
  • If set to yes, we will evaluate document.title from the web content and update the title. Defaults to YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldUpdateTitleFromWebContent;

    Swift

    var shouldUpdateTitleFromWebContent: Bool { get set }
  • The excluded activities. Defaults to @[UIActivityTypePostToWeibo, UIActivityTypePostToTencentWeibo, UIActivityTypeSaveToCameraRoll].

    Declaration

    Objective-C

    @property (nonatomic, copy) NSArray<NSString *> *_Nonnull excludedActivities;

    Swift

    var excludedActivities: [String] { get set }
  • A Boolean value indicating whether the web view suppresses content rendering until it is fully loaded into memory. Defaults to false.

    Declaration

    Objective-C

    @property (nonatomic) BOOL suppressesIncrementalRendering;

    Swift

    var suppressesIncrementalRendering: Bool { get set }
  • Called on error events if useCustomErrorPage is set.

    Loads the contents of standard-error.html from inside PSPDFKit.bundle.

    Declaration

    Objective-C

    - (void)showHTMLWithError:(nonnull NSError *)error;

    Swift

    func showHTMLWithError(_ error: Error)
  • This is your chance to modify the settings on the activity controller before it’s displayed.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) UIActivityViewController *createDefaultActivityViewController;

    Swift

    var createDefaultActivityViewController: UIActivityViewController? { get }

    Return Value

    null if the URL is not set.

  • Go back in history.

    Declaration

    Objective-C

    - (void)goBack:(nullable id)sender;

    Swift

    func goBack(_ sender: Any?)
  • Go forward in history.

    Declaration

    Objective-C

    - (void)goForward:(nullable id)sender;

    Swift

    func goForward(_ sender: Any?)
  • Reload page.

    Declaration

    Objective-C

    - (void)reload:(nullable id)sender;

    Swift

    func reload(_ sender: Any?)
  • Stop page loading.

    Declaration

    Objective-C

    - (void)stop:(nullable id)sender;

    Swift

    func stop(_ sender: Any?)
  • Show activity view controller.

    Declaration

    Objective-C

    - (void)action:(nullable UIBarButtonItem *)sender;

    Swift

    func action(_ sender: UIBarButtonItem?)
  • Dismiss PSPDFWebViewController.

    Declaration

    Objective-C

    - (void)done:(nullable id)sender;

    Swift

    func done(_ sender: Any?)