PSPDFWebViewController


@interface PSPDFWebViewController
    : PSPDFBaseViewController <PSPDFStyleable, UIWebViewDelegate>

Inline Web Browser.

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

    Declaration

    Objective-C

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

    Swift

    class func modalWebView(with URL: URL) -> Any!
  • 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 PSPDFWebViewControllerAvailableActionsAll&~PSPDFWebViewControllerAvailableActionsStopReload on iPad and PSPDFWebViewControllerAvailableActionsAll on iPhone (but with conditionally visible toolbars).

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        PSPDFWebViewControllerAvailableActions availableActions;

    Swift

    var availableActions: PSPDFWebViewControllerAvailableActions { get set }
  • Associated delegate, connects to the PSPDFViewController.

    Declaration

    Objective-C

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

    Swift

    @IBOutlet weak var delegate: PSPDFWebViewControllerDelegate? { get set }
  • If enabled, shows a progress indicator much like Safari on iOS 7. Defaults to YES. Set this before the view is loaded.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL showProgressIndicator;

    Swift

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

    Declaration

    Objective-C

    @property (assign, readwrite, 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 (assign, readwrite, nonatomic) BOOL shouldUpdateTitleFromWebContent;

    Swift

    var shouldUpdateTitleFromWebContent: Bool { get set }
  • Uses WKWebView when available. Needs to be set before the view is initialized. YES on iOS 8 and higher. This can also be controlled via the global PSPDFWebKitLegacyModeKey setting.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL useModernWebKit;

    Swift

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

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic)
        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 NO.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL suppressesIncrementalRendering;

    Swift

    var suppressesIncrementalRendering: Bool { get set }
  • Internal webview. Either UIWebView or WKWebView. WKWebView is used on iOS 9, while the classical web view is used on iOS 8.

    Declaration

    Objective-C

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

    Swift

    var webView: NSView { get }
  • Called on error events if useCustomErrorPage is set. Uses the StandardError.html 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. - returns: null if the URL is not set.

    Declaration

    Objective-C

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

    Swift

    var createDefaultActivityViewController: NSSplitViewController? { 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: Any!)
  • Dismiss PSPDFWebViewController.

    Declaration

    Objective-C

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

    Swift

    func done(_ sender: Any?)