PTDocumentViewController

@interface PTDocumentViewController
    : UIViewController <PTDocumentOpening, PTPDFViewCtrlDelegate,
                        PTToolManagerDelegate, PTOverridable,
                        UIPopoverPresentationControllerDelegate>

A view controller that displays a PTPDFViewCtrl along with other controls.

  • Returns an initialized PTDocumentViewController.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()

    Return Value

    an initialized PTDocumentViewController.

  • The view controller’s underlying PTPDFViewCtrl.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) PTPDFViewCtrl *_Nonnull pdfViewCtrl;

    Swift

    var pdfViewCtrl: PTPDFViewCtrl { get }
  • The tool manager attached to the underlying PTPDFViewCtrl.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic) PTToolManager *_Nonnull toolManager;

    Swift

    var toolManager: PTToolManager { get }
  • Sets the document property with the given document.

    Declaration

    Objective-C

    - (BOOL)setDocument:(nonnull PTPDFDoc *)document
                  error:(NSError *_Nullable *_Nullable)error;

    Swift

    func setDocument(_ document: PTPDFDoc) throws

    Parameters

    document

    The document to use.

    error

    On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify nil for this parameter if you do not want the error information.

    Return Value

    YES if the document could be set. Returns NO if an error occurred.

  • Sets the coordinatedDocument property to the given document wrapper instance.

    Declaration

    Objective-C

    - (void)
    setCoordinatedDocument:(nonnull PTCoordinatedDocument *)coordinatedDocument
         completionHandler:(nullable void (^)(NSError *_Nullable))completionHandler;

    Swift

    func setCoordinatedDocument(_ coordinatedDocument: PTCoordinatedDocument, completionHandler: ((Error?) -> Void)? = nil)

    Parameters

    coordinatedDocument

    The document wrapper to use.

    completionHandler

    Called after the document is opened. If there was an error, the error parameter is filled with information. If there was no error, the parameter is Nil.

  • The document to display in the PTPDFViewCtrl, set via the -setDocument:error: method. If an error occurs in the setter method then the property will be nil.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) PTPDFDoc *document;

    Swift

    var document: PTPDFDoc? { get }
  • The document wrapper to display, set via the -setCoordinatedDocument:error: method. If an error occurs in the setter method then the property will be nil.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable)
        PTCoordinatedDocument *coordinatedDocument;

    Swift

    var coordinatedDocument: PTCoordinatedDocument? { get }
  • Save the current document with the specified options.

    Declaration

    Objective-C

    - (void)saveDocument:(PTSaveOptions)saveOptions
        completionHandler:(nullable void (^)(BOOL))completionHandler;

    Swift

    func saveDocument(_ saveOptions: PTSaveOptions, completionHandler: ((Bool) -> Void)? = nil)

    Parameters

    saveOptions

    The options to save the document with.

    completionHandler

    A block with code that is executed when the save operation concludes. The block returns no value, and the success param is YES if the save operation succeeds, otherwise NO.

  • Whether changes in the document are saved automatically. The default value is YES.

    Declaration

    Objective-C

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

    Swift

    var automaticallySavesDocument: Bool { get set }
  • The interval in seconds that the document is automatically saved. The default value is PTDocumentViewControllerSaveDocumentInterval.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        NSTimeInterval automaticDocumentSavingInterval;

    Swift

    var automaticDocumentSavingInterval: TimeInterval { get set }
  • Restart the automatic document saving timer with the interval specified in the automaticDocumentSavingInterval property.

    Declaration

    Objective-C

    - (void)restartAutomaticDocumentSavingTimer;

    Swift

    func restartAutomaticDocumentSavingTimer()
  • Restart the automatic document saving timer with the specified interval.

    The `automaticDocumentSavingInterval1 property is updated with the specified interval.

    Declaration

    Objective-C

    - (void)restartAutomaticDocumentSavingTimerWithInterval:
        (NSTimeInterval)interval;

    Swift

    func restartAutomaticDocumentSavingTimer(withInterval interval: TimeInterval)

    Parameters

    interval

    The interval to use for automatic document saving.

  • Stop the automatic document saving timer.

    Declaration

    Objective-C

    - (void)stopAutomaticDocumentSavingTimer;

    Swift

    func stopAutomaticDocumentSavingTimer()
  • Closes the document after saving with the -saveDocument:completionHandler: method.

    Declaration

    Objective-C

    - (void)closeDocument;

    Swift

    func closeDocument()
  • Whether night mode is enabled for the pdfViewCtrl. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isNightModeEnabled, assign, readwrite, nonatomic)
        BOOL nightModeEnabled;

    Swift

    var isNightModeEnabled: Bool { get set }
  • Controls if the ThumbnailSlider is enabled. The default value is YES.

    Declaration

    Objective-C

    @property (getter=isBottomToolbarEnabled, assign, readwrite, nonatomic)
        BOOL bottomToolbarEnabled;

    Swift

    var isBottomToolbarEnabled: Bool { get set }
  • Controls if the PTPageIndicatorViewController is enabled. The default value is YES.

    Declaration

    Objective-C

    @property (getter=isPageIndicatorEnabled, assign, readwrite, nonatomic)
        BOOL pageIndicatorEnabled;

    Swift

    var isPageIndicatorEnabled: Bool { get set }
  • Controls the visibility of the settingsButtonItem in the navigation bar. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isViewerSettingsButtonHidden, assign, readwrite, nonatomic)
        BOOL viewerSettingsButtonHidden;

    Swift

    var isViewerSettingsButtonHidden: Bool { get set }
  • Controls the visibility of the shareButtonItem in the navigation bar. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isShareButtonHidden, assign, readwrite, nonatomic)
        BOOL shareButtonHidden;

    Swift

    var isShareButtonHidden: Bool { get set }
  • Controls the visibility of the searchButtonItem in the navigation bar. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isSearchButtonHidden, assign, readwrite, nonatomic)
        BOOL searchButtonHidden;

    Swift

    var isSearchButtonHidden: Bool { get set }
  • Controls the visibility of the annotationButtonItem in the navigation bar. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isAnnotationToolbarButtonHidden, assign, readwrite, nonatomic)
        BOOL annotationToolbarButtonHidden;

    Swift

    var isAnnotationToolbarButtonHidden: Bool { get set }
  • Controls the visibility of the thumbnailsButtonItem on the leading side of the PTThumbnailsViewController. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isThumbnailBrowserButtonHidden, assign, readwrite, nonatomic)
        BOOL thumbnailBrowserButtonHidden;

    Swift

    var isThumbnailBrowserButtonHidden: Bool { get set }
  • Controls the visibility of the navigationListsButtonItem on the trailing side of the PTThumbnailsViewController. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isNavigationListsButtonHidden, assign, readwrite, nonatomic)
        BOOL navigationListsButtonHidden;

    Swift

    var isNavigationListsButtonHidden: Bool { get set }
  • Shows the PTTextSearchViewController toolbar for text search.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UIBarButtonItem *_Nonnull searchButtonItem;

    Swift

    var searchButtonItem: UIBarButtonItem { get }
  • Shows a UIDocumentInteractionController for the current document.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UIBarButtonItem *_Nonnull shareButtonItem;

    Swift

    var shareButtonItem: UIBarButtonItem { get }
  • Shows a PTSettingsViewController to control the view settings.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UIBarButtonItem *_Nonnull settingsButtonItem;

    Swift

    var settingsButtonItem: UIBarButtonItem { get }
  • Shows a PTThumbnailsViewController for the current document.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UIBarButtonItem *_Nonnull thumbnailsButtonItem;

    Swift

    var thumbnailsButtonItem: UIBarButtonItem { get }
  • Shows a PTNavigationListsViewController with outline, annotations, and bookmarks view controllers.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UIBarButtonItem *_Nonnull navigationListsButtonItem;

    Swift

    var navigationListsButtonItem: UIBarButtonItem { get }
  • Shows the PTAnnotationToolbar toolbar for annotating.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic)
        UIBarButtonItem *_Nonnull annotationButtonItem;

    Swift

    var annotationButtonItem: UIBarButtonItem { get }
  • Whether the navigation bar, toolbars, and other controls are hidden. The default value is NO.

    Declaration

    Objective-C

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

    Swift

    var controlsHidden: Bool { get set }
  • Sets whether the controls are hidden.

    For animated transitions, the duration of the animation is specified by the value in the UINavigationControllerHideShowBarDuration constant.

    Declaration

    Objective-C

    - (void)setControlsHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setControlsHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the controls or NO to show them

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the controls to appear immediately.

  • Whether the annotation toolbar is hidden. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isAnnotationToolbarHidden, assign, readwrite, nonatomic)
        BOOL annotationToolbarHidden;

    Swift

    var isAnnotationToolbarHidden: Bool { get set }
  • Whether the find text toolbar is hidden. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isSearchViewControllerHidden, assign, readwrite, nonatomic)
        BOOL searchViewControllerHidden;

    Swift

    var isSearchViewControllerHidden: Bool { get set }
  • Whether the thumbnail slider control is hidden. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isThumbnailSliderHidden, assign, readwrite, nonatomic)
        BOOL thumbnailSliderHidden;

    Swift

    var isThumbnailSliderHidden: Bool { get set }
  • Sets whether the thumbnail slider control is hidden.

    For animated transitions, the duration of the animation is specified by the value in the UINavigationControllerHideShowBarDuration constant.

    Declaration

    Objective-C

    - (void)setThumbnailSliderHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setThumbnailSliderHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the thumbnail slider or NO to show it

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the control to appear immediately

  • Whether the page indicator control is hidden. The default value is NO.

    Declaration

    Objective-C

    @property (getter=isPageIndicatorHidden, assign, readwrite, nonatomic)
        BOOL pageIndicatorHidden;

    Swift

    var isPageIndicatorHidden: Bool { get set }
  • Sets whether the page indicator control is hidden.

    Declaration

    Objective-C

    - (void)setPageIndicatorHidden:(BOOL)hidden animated:(BOOL)animated;

    Swift

    func setPageIndicatorHidden(_ hidden: Bool, animated: Bool)

    Parameters

    hidden

    Specify YES to hide the page indicator or NO to show it.

    animated

    Specify YES if you want to animate the change in visibility or NO if you want the control to appear immediately.

  • Whether the reflow control is hidden. The default value is YES.

    Declaration

    Objective-C

    @property (getter=isReflowHidden, assign, readwrite, nonatomic)
        BOOL reflowHidden;

    Swift

    var isReflowHidden: Bool { get set }
  • Whether the controls are hidden automatically after a period of time. The default value is YES.

    The automaticControlHidingDelay is used to specify the time delay.

    Declaration

    Objective-C

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

    Swift

    var automaticallyHidesControls: Bool { get set }
  • The number of seconds to wait before automatically hiding the controls. The default value is PTDocumentViewControllerHideControlsInterval.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        NSTimeInterval automaticControlHidingDelay;

    Swift

    var automaticControlHidingDelay: TimeInterval { get set }
  • Restart the automatic control hiding timer with the delay specified in the automaticControlHidingDelay property.

    Declaration

    Objective-C

    - (void)restartAutomaticControlHidingTimer;

    Swift

    func restartAutomaticControlHidingTimer()
  • Restart the automatic control hiding timer with the specified delay.

    The automaticControlHidingDelay property is updated with the specified delay.

    Declaration

    Objective-C

    - (void)restartAutomaticControlHidingTimerWithDelay:(NSTimeInterval)delay;

    Swift

    func restartAutomaticControlHidingTimer(withDelay delay: TimeInterval)

    Parameters

    delay

    The delay to use for automatic control hiding.

  • Stop the automatic control hiding timer.

    Declaration

    Objective-C

    - (void)stopAutomaticControlHidingTimer;

    Swift

    func stopAutomaticControlHidingTimer()