PTDocumentBaseViewController

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

  • Returns an initialized PTDocumentBaseViewController.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()

    Return Value

    an initialized PTDocumentBaseViewController.

  • The view controller’s underlying PTPDFViewCtrl.

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var toolManager: PTToolManager { get }
  • Open a document with the given URL.

    Declaration

    Objective-C

    - (void)openDocumentWithURL:(nonnull NSURL *)url;

    Swift

    func openDocument(with url: URL)

    Parameters

    url

    The URL to open.

  • Open a document with the given URL and password.

    Declaration

    Objective-C

    - (void)openDocumentWithURL:(nonnull NSURL *)url
                       password:(nullable NSString *)password;

    Swift

    func openDocument(with url: URL, password: String?)

    Parameters

    url

    The URL to open.

    password

    The password for the document.

  • Open a document with the given URL and options.

    Declaration

    Objective-C

    - (void)openDocumentWithURL:(nonnull NSURL *)url
                        options:(nullable PTDocumentOptions *)options;

    Swift

    func openDocument(with url: URL, options: PTDocumentOptions?)

    Parameters

    url

    The URL to open

    options

    The options for the opening the document

  • Open the given PTPDFDoc.

    Declaration

    Objective-C

    - (void)openDocumentWithPDFDoc:(nonnull PTPDFDoc *)document;

    Swift

    func openDocument(with document: PTPDFDoc)

    Parameters

    document

    The PTPDFDoc to open.

  • PTHTTPRequestOptions that will be used when requesting remote documents over HTTP. These can be used to set additional HTTP headers and control if a linearized document should be downloaded in its entirety, or only the parts that are viewed.

    Declaration

    Objective-C

    @property (nonatomic, strong, nonnull) PTHTTPRequestOptions *httpRequestOptions;

    Swift

    var httpRequestOptions: PTHTTPRequestOptions { get set }
  • Specifies additional http headers which will be set on outgoing requests and when requesting remote documents over HTTP.

    Headers specified in this dictionary will overwrite any (matching) existing headers in the httpRequestOptions property.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSDictionary<NSString *, NSString *> *additionalHTTPHeaders;

    Swift

    var additionalHTTPHeaders: [String : String]? { get set }
  • Options that will be used when converting documents with the PTConvert APIs via the -openDocumentWithURL: method.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTConversionOptions *_Nonnull conversionOptions;

    Swift

    var conversionOptions: PTConversionOptions { get set }
  • The PTPDFDoc if the viewer is displaying a document opened with openDocumentWithPDFDoc:.

    Declaration

    Objective-C

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

    Swift

    var document: PTPDFDoc? { get }
  • The PTCoordinatedDocument if the viewer opens a local file with openDocumentWithURL:.

    Declaration

    Objective-C

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

    Swift

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

    If the saveOptions include the e_ptincremental flag, and it is not possible to save incrementally (e.g. in the case that the xref table needed to be repaired), then the incremental flag will be ignored.

    Declaration

    Objective-C

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

    Swift

    func saveDocument(_ saveOptions: PTSaveOptions) async -> Bool

    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. The document is saved on best-effort basis on a timer with a period of automaticDocumentSavingInterval. The document is also saved when the app resigns the foreground, or this ViewController’s view disappears.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallySavesDocument;

    Swift

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

    The default value is PTDocumentViewControllerSaveDocumentInterval.

    Setting the interval to DBL_MAX disables the timer entirely.

    Declaration

    Objective-C

    @property (nonatomic) NSTimeInterval automaticDocumentSavingInterval;

    Swift

    var automaticDocumentSavingInterval: TimeInterval { get set }
  • If a save is attempted, and cannot be completed, a UIAlertController is shown with the title “Saving Error”. The errorMessage string is the message detail that is displayed. The default value is “The document could not be saved due to an error.”.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull saveErrorMessage;

    Swift

    var saveErrorMessage: String { 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 automaticDocumentSavingInterval 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()
  • In cases where the original document cannot be saved back to its source location, and the view controller is being deallocated and its document contains unsaved changes, this property controls whether a backup copy of the document is saved to disk.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isDocumentBackupSavingEnabled)
        BOOL documentBackupSavingEnabled;

    Swift

    var isDocumentBackupSavingEnabled: Bool { get set }
  • The file URL of the directory where document backups should be saved.

    The default value of this property is the application’s user-visible Documents/ directory.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSURL *documentBackupDirectoryURL;

    Swift

    var documentBackupDirectoryURL: URL? { get set }
  • Whether tapping on the right or left edges of the page in single page-presentation mode (non-continuous) will change the current page to the next or previous page, respectively.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL changesPageOnTap;

    Swift

    var changesPageOnTap: Bool { get set }
  • Whether the pdfViewCtrl page fits between the top navigation bar and bottom toolbar. When disabled, the page content will fit to the size of this view controller and scroll if necessary; when enabled, the page content will fit in the visible space between the bars without scrolling (at the minimum zoom scale).

    This property controls the view controller’s edgesForExtendedLayout property: the UIRectEdgeTop and UIRectEdgeBottom values are excluded from that bitmask property when the pageFitsBetweenBars property is enabled.

    The isTranslucent property of the PTThumbnailSliderViewController.toolbar is also affected by the pageFitsBetweenBars property: when this property is enabled, the thumbnail slider’s toolbar is set to be non-translucent. Otherwise, the toolbar is translucent.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL pageFitsBetweenBars;
  • Whether night mode is enabled for the pdfViewCtrl. The default value is NO.

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var isBottomToolbarEnabled: Bool { get set }
  • Controls if the thumbnailSliderController is enabled.

    The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isThumbnailSliderEnabled) BOOL thumbnailSliderEnabled;

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var isPageIndicatorEnabled: Bool { get set }
  • Whether the PTPageIndicatorViewController is shown when the current page changes. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL pageIndicatorShowsOnPageChange;

    Swift

    var pageIndicatorShowsOnPageChange: Bool { get set }
  • Whether the PTPageIndicatorViewController is shown with the navigation bar and toolbars. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL pageIndicatorShowsWithControls;

    Swift

    var pageIndicatorShowsWithControls: Bool { get set }
  • Whether the PTPageIndicatorViewController is always visible. If false, the indicator will fade away when the toolbars hide, or after a short period of time looking at the same page. The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL pageIndicatorAlwaysVisible;

    Swift

    var pageIndicatorAlwaysVisible: Bool { get set }
  • Declaration

    Objective-C

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

    Swift

    var readerModeButtonItem: UIBarButtonItem { get }
  • Shows the PTTextSearchViewController toolbar for text search.

    Declaration

    Objective-C

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

    Swift

    var searchButtonItem: UIBarButtonItem { get }
  • Shows options for exporting the document.

    Declaration

    Objective-C

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

    Swift

    var exportButtonItem: UIBarButtonItem { get }
  • Exports a copy of the document.

    Declaration

    Objective-C

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

    Swift

    var exportCopyButtonItem: UIBarButtonItem { get }
  • Exports a flattened copy of the document.

    Declaration

    Objective-C

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

    Swift

    var exportFlattenedCopyButtonItem: UIBarButtonItem { get }
  • Exports a reduced file size copy of the document.

    Declaration

    Objective-C

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

    Swift

    var exportReducedFileSizeCopyButtonItem: UIBarButtonItem { get }
  • Exports a cropped copy of the document.

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var settingsButtonItem: UIBarButtonItem { get }
  • Shows a PTToolsSettingsViewController to control the view settings.

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

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

    Swift

    var navigationListsButtonItem: UIBarButtonItem { get }
  • Declaration

    Objective-C

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

    Swift

    var moreItemsButtonItem: UIBarButtonItem { get }
  • Declaration

    Objective-C

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

    Swift

    var addPagesButtonItem: UIBarButtonItem { get }
  • Adds a bookmark to the current page, or removes the existing bookmark of the current page.

    Declaration

    Objective-C

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

    Swift

    var bookmarkPageButtonItem: UIBarButtonItem { get }
  • Controls the visibility of the readerModeButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isReaderModeButtonHidden) BOOL readerModeButtonHidden;

    Swift

    var isReaderModeButtonHidden: Bool { get set }
  • Controls the visibility of the settingsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

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

    Swift

    var isViewerSettingsButtonHidden: Bool { get set }
  • Controls the visibility of the appSettingsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isAppSettingsButtonHidden) BOOL appSettingsButtonHidden;

    Swift

    var isAppSettingsButtonHidden: Bool { get set }
  • Controls the visibility of the shareButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

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

    Swift

    var isShareButtonHidden: Bool { get set }
  • Controls the visibility of the searchButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

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

    Swift

    var isSearchButtonHidden: Bool { get set }
  • Controls the visibility of the export button in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isExportButtonHidden) BOOL exportButtonHidden;

    Swift

    var isExportButtonHidden: Bool { get set }
  • Controls the visibility of the moreItemsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isMoreItemsButtonHidden) BOOL moreItemsButtonHidden;

    Swift

    var isMoreItemsButtonHidden: Bool { get set }
  • Controls the visibility of the addPagesButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isAddPagesButtonHidden) BOOL addPagesButtonHidden;

    Swift

    var isAddPagesButtonHidden: Bool { get set }
  • Controls the visibility of the bookmarkPageButtonItem in the navigation bar, bottom toolbar.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isBookmarkPageButtonHidden) BOOL bookmarkPageButtonHidden;

    Swift

    var isBookmarkPageButtonHidden: Bool { get set }
  • Controls the visibility of the thumbnailsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

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

    Swift

    var isThumbnailBrowserButtonHidden: Bool { get set }
  • Controls the visibility of the navigationListsButtonItem in the navigation bar, bottom toolbar, and more items list.

    The default value of this property is NO.

    Declaration

    Objective-C

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

    Swift

    var isNavigationListsButtonHidden: Bool { get set }
  • The toolbar items associated with the view controller.

    The getter for this property returns -toolbarItemsForSizeClass: for the current horizontal user interface size class, and the setters uses -setToolbarItems:forSizeClass:animated: to set the toolbar items for all user interface size classes.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *toolbarItems;

    Swift

    var toolbarItems: [UIBarButtonItem]? { get set }
  • Returns the toolbarItems for the given horizontal user interface size class.

    Declaration

    Objective-C

    - (nullable NSArray<UIBarButtonItem *> *)toolbarItemsForSizeClass:
        (UIUserInterfaceSizeClass)sizeClass;

    Swift

    func toolbarItems(for sizeClass: UIUserInterfaceSizeClass) -> [UIBarButtonItem]?

    Parameters

    sizeClass

    the horizontal user interface size class for which to get the list of items

    Return Value

    the toolbarItems for the given horizontal user interface size class

  • Sets the toolbarItems used for the given horizontal size class.

    Declaration

    Objective-C

    - (void)setToolbarItems:(nullable NSArray<UIBarButtonItem *> *)toolbarItems
               forSizeClass:(UIUserInterfaceSizeClass)sizeClass
                   animated:(BOOL)animated;

    Swift

    func setToolbarItems(_ toolbarItems: [UIBarButtonItem]?, for sizeClass: UIUserInterfaceSizeClass, animated: Bool)

    Parameters

    toolbarItems

    the toolbar items to use

    sizeClass

    the horizontal user interface size class

    animated

    whether to animate the change

  • The items currently shown by the moreItemsViewController in a list-style interface for the current trait collection.

    The getter for this property returns -moreItemsForSizeClass: for the current horizontal user inteface size class, and the setter uses -setMoreItems:forSizeClass: to set the items for all user interface size classes.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *moreItems;

    Swift

    var moreItems: [UIBarButtonItem]? { get set }
  • Returns the moreItems shown by the moreItemsViewController for the given horizontal user interface size class.

    Declaration

    Objective-C

    - (nullable NSArray<UIBarButtonItem *> *)moreItemsForSizeClass:
        (UIUserInterfaceSizeClass)sizeClass;

    Swift

    func moreItems(for sizeClass: UIUserInterfaceSizeClass) -> [UIBarButtonItem]?

    Parameters

    sizeClass

    the horizontal user interface size class for which to get the list of items

    Return Value

    the items shown by the moreItemsViewController for the given horizontal user interface size class

  • Sets the moreItems shown by the moreItemsViewController for the given horizontal user interface size class.

    Declaration

    Objective-C

    - (void)setMoreItems:(nullable NSArray<UIBarButtonItem *> *)moreItems
            forSizeClass:(UIUserInterfaceSizeClass)sizeClass;

    Swift

    func setMoreItems(_ moreItems: [UIBarButtonItem]?, for sizeClass: UIUserInterfaceSizeClass)

    Parameters

    moreItems

    the items to show

    sizeClass

    the horizontal user interface size class

  • The items currently shown by the moreItemsViewController.

    The getter for this property returns -moreItemsForSizeClass: for the current horizontal user inteface size class, and the setter uses -setMoreItems:forSizeClass: to set the items for all user interface size classes.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSArray<UIBarButtonItem *> *exportItems;

    Swift

    var exportItems: [UIBarButtonItem]? { get set }
  • Whether the controls are toggled in response to an otherwise unhandled tap.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hidesControlsOnTap;

    Swift

    var hidesControlsOnTap: Bool { get set }
  • Whether the isNavigationBarHidden property of this view controller’s containing UINavigationController is controlled by this view controller.

    When enabled, this view controller will update the UINavigationController.isNavigationBarHidden property as part of its bar-hiding (and -showing) behavior. Otherwise, this view controller will not update the isNavigationBarHidden property and it is the responsibility of users of this class to ensure that the bars are consistent with the desired behavior and appearance.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hidesNavigationBar;

    Swift

    var hidesNavigationBar: Bool { get set }
  • Whether the isToolbarHidden property of this view controller’s UINavigationController is controlled by this view controller.

    When enabled, this view controller will update the UINavigationController.isToolbarHidden property as part of its bar-hiding (and -showing) behavior. Otherwise, this view controller will not update the isToolbarHidden property and it is the responsibility of users of this class to ensure that the bars are consistent with the desired behavior and appearance.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL hidesBottomBar;

    Swift

    var hidesBottomBar: Bool { get set }
  • Whether the navigation bar, toolbars, and other controls are hidden. When hiding or showing controls, the hidesNavigationBar and hidesBottomBar properties are respected.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (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 find text toolbar is hidden. The default value is NO.

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isThumbnailSliderHidden) 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 YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isPageIndicatorHidden) 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 (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isReflowHidden) BOOL reflowHidden;

    Swift

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

    The automaticControlHidingDelay is used to specify the time delay.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallyHidesControls;

    Swift

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

    The automaticControlHidingDelay is used to specify the time delay.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallyHideToolbars;

    Swift

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

    Declaration

    Objective-C

    @property (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()
  • Whether the controls should be hidden in response to the given timer firing.

    The default implementation of this method returns the value of the automaticallyHideToolbars property.

    Declaration

    Objective-C

    - (BOOL)shouldHideControlsFromTimer:(nonnull NSTimer *)timer;

    Swift

    func shouldHideControls(from timer: Timer) -> Bool
  • Returns an object initialized from data in a given unarchiver.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCoder:(nonnull NSCoder *)coder;

    Swift

    init(coder: NSCoder)
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
  • Whether view state persistence is enabled.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isViewStatePersistenceEnabled)
        BOOL viewStatePersistenceEnabled;

    Swift

    var isViewStatePersistenceEnabled: Bool { get set }
  • The string used to identify the saved view state for a document among other metadata.

    The default value of this property is a Tools-specific identifier string.

    Declaration

    Objective-C

    @property (class, nonatomic, copy, null_resettable) NSString *savedViewStateIdentifier;

    Swift

    class var savedViewStateIdentifier: String! { get set }
  • Saves the document’s current view state.

    Note

    In Swift, this method is imported as a throwing function.

    Declaration

    Objective-C

    - (BOOL)saveCurrentViewStateForDocumentWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func saveCurrentViewStateForDocument() throws

    Parameters

    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 view state was saved, NO otherwise if an error occurred

  • Restores the document’s saved view state.

    Note

    In Swift, this method is imported as a throwing function.

    Declaration

    Objective-C

    - (BOOL)restoreCurrentViewStateForDocumentWithError:
        (NSError *_Nullable *_Nullable)error;

    Swift

    func restoreCurrentViewStateForDocument() throws

    Parameters

    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 view state was restored, NO otherwise if an error occurred

  • This method is called when a document has been successfully opened in this view controller.

    Declaration

    Objective-C

    - (void)didOpenDocument;

    Swift

    func didOpenDocument()
  • This method is called when a document could not be opened in this view controller.

    Declaration

    Objective-C

    - (void)handleDocumentOpeningFailureWithError:(nullable NSError *)error;

    Swift

    func handleDocumentOpeningFailureWithError(_ error: Error?)

    Parameters

    error

    The error object describing the failure. May be nil if information regarding the failure was not available

  • This method is called when the view controller enters an invalid state.

    In response, the document could be re-opened or this view controller could be closed or dismissed.

    Declaration

    Objective-C

    - (void)didBecomeInvalid;

    Swift

    func didBecomeInvalid()
  • This method is called when the panel is opened.

    Declaration

    Objective-C

    - (void)didShowLeadingPanelViewController:
        (nonnull UIViewController *)viewController;

    Swift

    func didShowLeadingPanelViewController(_ viewController: UIViewController)
  • This method is called when the panel is closed.

    Declaration

    Objective-C

    - (void)didDismissLeadingPanelViewController:
        (nonnull UIViewController *)viewController;

    Swift

    func didDismissLeadingPanelViewController(_ viewController: UIViewController)
  • Returns whether the cached document at the given temporary URL should be exported to a different permanent location. The temporary URL does not point to a user-visible location and if the cached document is not exported it may be deleted by the system at any time.

    The default implementation of this method returns YES.

    Declaration

    Objective-C

    - (BOOL)shouldExportCachedDocumentAtURL:(nonnull NSURL *)cachedDocumentURL;

    Swift

    func shouldExportCachedDocument(at cachedDocumentURL: URL) -> Bool

    Parameters

    cachedDocumentURL

    the temporary URL of the cached document

    Return Value

    YES if the cached document should be exported, NO otherwise.

  • Returns the destination URL for the document at the given source URL location. If nil is returned from this method, the document will be copied to the user-visible Documents directory inside the containing app’s sandbox.

    The default implementation of this method returns nil.

    Declaration

    Objective-C

    - (nullable NSURL *)destinationURLforDocumentAtURL:(nonnull NSURL *)sourceURL;

    Swift

    func destinationURLforDocument(at sourceURL: URL) -> URL?

    Parameters

    sourceURL

    The source URL of the document

    Return Value

    the destination URL for the document

  • Returns whether the cached document at the given URL should be deleted. If the cached document has been exported to a different location, as indicated by the -shouldExportCachedDocumentAtURL: and -destinationURLforDocumentAtURL: methods, the original copy of the document can be deleted by returning YES for this method.

    If it is desired that HTTP(S) documents should not be re-downloaded unless necessary (ie. unless the remote file has changed since it was last downloaded), then the cached document should not be deleted.

    The default implementation of this method returns NO.

    Declaration

    Objective-C

    - (BOOL)shouldDeleteCachedDocumentAtURL:(nonnull NSURL *)cachedDocumentURL;

    Swift

    func shouldDeleteCachedDocument(at cachedDocumentURL: URL) -> Bool

    Parameters

    cachedDocumentURL

    The URL of the cached document

  • Returns whether the controls should be hidden in response to a timer (if the automaticallyHidesControls property is enabled) or user tap (if the hidesControlsOnTap property is enabled).

    The default implementation of this method returns YES if this view controller is not currently presenting another view controller and does not have another modal-type control active.

    Declaration

    Objective-C

    - (BOOL)shouldHideControls;

    Swift

    func shouldHideControls() -> Bool

    Return Value

    YES if the view controller’s controls should be hidden, NO otherwise

  • Returns whether the view controller’s controls should be shown in response to a user tap (if the hidesControlsOnTap property is enabled).

    The default implementation of this method return YES if this view controller’s containing UINavigationController currently has its navigation bar hidden and no other view controllers are currently presented.

    Declaration

    Objective-C

    - (BOOL)shouldShowControls;

    Swift

    func shouldShowControls() -> Bool

    Return Value

    YES if the view controller’s controls should be shown, NO otherwise.

  • Called when the hidden state of the controls has actually been changed.

    Declaration

    Objective-C

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

    Swift

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

    Parameters

    hidden

    The new hidden state of the controls

    animated

    Whether the change was animated

  • Returns whether the text search view controller should be dismissed when the view controller’s view disappears.

    The default implementation of this method returns YES.

    Declaration

    Objective-C

    - (BOOL)shouldAutomaticallyDismissSearchViewController;

    Swift

    func shouldAutomaticallyDismissSearch() -> Bool

    Return Value

    YES if the view controller’s controls should be hidden, NO otherwise