PSPDFDocumentInfoCoordinator

Objective-C


@interface PSPDFDocumentInfoCoordinator : NSObject <PSPDFOverridable>

Swift

class DocumentInfoCoordinator : NSObject, Overridable

Coordinates a common view controller for document metadata, such as outline, bookmarks or annotations.

  • Builds and returns the document info view controller.

    Declaration

    Objective-C

    - (nullable UIViewController *)documentInfoViewController;

    Swift

    func documentInfoViewController() -> UIViewController?
  • Present view controller on targetController.

    Declaration

    Objective-C

    - (nullable UIViewController *)
        presentToViewController:
            (nonnull UIViewController<PSPDFPresentationActions> *)targetController
                        options:(nullable NSDictionary<NSString *, id> *)options
                         sender:(nullable id)sender
                       animated:(BOOL)animated
                     completion:(nullable void (^)(void))completion;
  • Checks if there’s data to present.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isAvailable) BOOL available;

    Swift

    var isAvailable: Bool { get }
  • The document attached to the document info coordinator.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        PSPDFDocument *document;

    Swift

    var document: PSPDFDocument? { get set }
  • This protocol inherits from PSPDFOverridable since it’s also used to fetch subclasses.

    Declaration

    Objective-C

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

    Swift

    weak var delegate: PSPDFDocumentInfoCoordinatorDelegate? { get set }
  • Choose the controller type. Defaults to PSPDFDocumentInfoOptionOutline, PSPDFDocumentInfoOptionAnnotations, PSPDFDocumentInfoOptionBookmarks, PSPDFDocumentInfoOptionEmbeddedFiles, PSPDFDocumentInfoOptionDocumentInfo, PSPDFDocumentInfoOptionSecurity.

    Note

    Change this before the controller is being displayed.

    Declaration

    Objective-C

    @property (nonatomic, copy, readwrite)
        NSArray<PSPDFDocumentInfoOption> *_Nonnull availableControllerOptions;

    Swift

    var availableControllerOptions: [DocumentInfoOption] { get set }
  • Called after a controller has been created. Set a block to allow custom modifications. This sets the delegate of the controllers by default. If you set a custom block, ensure to call the previous implementation.

    Declaration

    Objective-C

    @property (nonatomic, copy, readwrite, nullable) void (^)
        (UIViewController *_Nonnull, PSPDFDocumentInfoOption _Nonnull)
            didCreateControllerBlock;

    Swift

    var didCreateControllerBlock: ((UIViewController, DocumentInfoOption) -> Void)? { get set }
  • Subclass to allow early controller customization.

    Declaration

    Objective-C

    - (nullable UIViewController *)controllerForOption:
        (nonnull PSPDFDocumentInfoOption)option;

    Swift

    func controller(forOption option: DocumentInfoOption) -> UIViewController?
  • Is used internally to filter unavailable options.

    Declaration

    Objective-C

    - (BOOL)isOptionAvailable:(nonnull PSPDFDocumentInfoOption)option;

    Swift

    func isOptionAvailable(_ option: DocumentInfoOption) -> Bool