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.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
PSPDFWebViewControllerAvailableActionsAll&~PSPDFWebViewControllerAvailableActionsStopReload
on iPad andPSPDFWebViewControllerAvailableActionsAll
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 insidePSPDFKit.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.
-
Go forward in history.
-
Reload page.
-
Stop page loading.
-
Show activity view controller.
Declaration
Objective-C
- (void)action:(nullable UIBarButtonItem *)sender;
Swift
func action(_ sender: UIBarButtonItem?)
-
Dismiss PSPDFWebViewController.