PSPDFApplication
Objective-C
@protocol PSPDFApplication <NSObject>
Swift
protocol Application : NSObjectProtocol
This class handles opening URLs for other applications and coordinates access to the network indicator manager since this is restricted in an iOS extension case.
-
Returns a Boolean value indicating whether or not the URL’s scheme can be handled by some app installed on the device.
Declaration
Objective-C
- (BOOL)canOpenURL:(nonnull NSURL *)url;
Swift
func canOpen(_ url: URL) -> Bool
Parameters
url
The URL to check.
Return Value
YES if the URL can be opened by an application on the system.
-
Asks the host to open an URL on the extension’s behalf if we are in an extension context.
Declaration
Objective-C
- (void)openURL:(nonnull NSURL *)url options:(nullable NSDictionary<NSString *, id> *)options completionHandler:(nullable void (^)(BOOL))completionHandler;
Swift
func open(_ url: URL, options: [String : Any]? = nil) async -> Bool
Parameters
url
The URL to open
options
Open options.
completionHandler
Calls the completion handler.
-
Coordinates access to the network indicator manager.
Declaration
Objective-C
@property (nonatomic, readonly) id<PSPDFNetworkActivityIndicatorManager> _Nonnull networkIndicatorManager;
Swift
var networkIndicatorManager: NetworkActivityIndicatorManager { get }