PSPDFTabbedViewController


@interface PSPDFTabbedViewController : PSPDFMultiDocumentViewController

Allows displaying multiple PSPDFDocuments, easily switchable via a top tab bar. Defaults to not showing the document title in the navigation bar and in the overlay, because the title is already displayed in the tab. You can change this behavior by modifying the showTitle property.

  • Inserts a document at the end of the tabbed bar, optionally making it the visible document. If documents already contains document then it will not be added again, but may become visible.

    Declaration

    Objective-C

    - (void)addDocument:(nonnull PSPDFDocument *)document
            makeVisible:(BOOL)shouldMakeDocumentVisible
               animated:(BOOL)animated;

    Swift

    func addDocument(_ document: PSPDFDocument, makeVisible shouldMakeDocumentVisible: Bool, animated: Bool)
  • Inserts a document into the tabbed bar after the current visible document, optionally making it the new visible document. If documents already contains document then it will not be inserted again or moved, but may become visible.

    Declaration

    Objective-C

    - (void)insertDocumentAfterVisibleDocument:(nonnull PSPDFDocument *)document
                                   makeVisible:(BOOL)shouldMakeDocumentVisible
                                      animated:(BOOL)animated;

    Swift

    func insertDocument(afterVisibleDocument document: PSPDFDocument, makeVisible shouldMakeDocumentVisible: Bool, animated: Bool)
  • Inserts a document into the tabbed bar at the specified index, optionally making it the visible document. If documents already contains document then it will not be inserted again or moved, but may become visible.

    Declaration

    Objective-C

    - (void)insertDocument:(nonnull PSPDFDocument *)document
                   atIndex:(NSUInteger)idx
               makeVisible:(BOOL)shouldMakeDocumentVisible
                  animated:(BOOL)animated;

    Swift

    func insertDocument(_ document: PSPDFDocument, at idx: UInt, makeVisible shouldMakeDocumentVisible: Bool, animated: Bool)
  • Removes a document at a specified index in documents from the tabbed bar. Raises NSRangeException is idx is outside the range of documents.

    Declaration

    Objective-C

    - (void)removeDocumentAtIndex:(NSUInteger)idx animated:(BOOL)animated;

    Swift

    func removeDocument(at idx: UInt, animated: Bool)
  • Removes a specified document from the tabbed bar. Does nothing if documents does not contain document.

    Declaration

    Objective-C

    - (BOOL)removeDocument:(nonnull PSPDFDocument *)document
                  animated:(BOOL)animated;

    Swift

    func removeDocument(_ document: PSPDFDocument, animated: Bool) -> Bool
  • Changes the currently visible document and optionally scrolls the tabbed bar to make the new selected tab visible.

    Declaration

    Objective-C

    - (void)setVisibleDocument:(nullable PSPDFDocument *)visibleDocument
              scrollToPosition:(BOOL)scrollToPosition
                      animated:(BOOL)animated;

    Swift

    func setVisibleDocument(_ visibleDocument: PSPDFDocument?, scrollToPosition: Bool, animated: Bool)
  • Delegate to capture events.

    Declaration

    Objective-C

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

    Swift

    @IBOutlet weak var delegate: PSPDFTabbedViewControllerDelegate? { get set }
  • Defaults to PSPDFTabbedDocumentsPersistKey. Change if you use multiple instances of PSPDFTabbedViewController.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *_Nonnull statePersistenceKey;

    Swift

    var statePersistenceKey: String { get set }
  • The bar that shows tabs for switching between documents. Its appearance is customizable.

    Declaration

    Objective-C

    @property (readonly, nonatomic) PSPDFTabbedBar *_Nonnull tabbedBar;

    Swift

    var tabbedBar: PSPDFTabbedBar { get }
  • The document picker controller to be shown when the tabbed bar’s document picker button has been tapped. The default is nil. Set this property to enable the document picker button. If the document picker controller has no delegate at the time of presentation, the tabbed PDF controller will provide the delegate.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable)
        PSPDFDocumentPickerController *documentPickerController;

    Swift

    var documentPickerController: PSPDFDocumentPickerController? { get set }
  • Whether the tabbed bar should be shown or hidden depending on if there are loaded documents. The default is PSPDFTabbedViewControllerBarHidingModeAutomatic if documentPickerController is nil, or PSPDFTabbedViewControllerBarHidingModeShow if documentPickerController is non-nil.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        PSPDFTabbedViewControllerBarHidingMode barHidingMode;

    Swift

    var barHidingMode: PSPDFTabbedViewControllerBarHidingMode { get set }
  • Determines how the user is able to close documents, which is possible using the close buttons in PSPDFTabbedBar and swipe-to-delete in PSPDFMultiDocumentListController. The default is PSPDFTabbedViewControllerCloseModeOnlySelectedTab.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        PSPDFTabbedViewControllerCloseMode closeMode;

    Swift

    var closeMode: PSPDFTabbedViewControllerCloseMode { get set }
  • A Boolean value that determines whether a PDF action that opens another PDF document should show this document in a separate tab. The default is YES. If NO, the document of the current tab will be changed and the old visible document will be replaced in documents. If the target document is already in documents, then the selected tab will change to show it whatever the value of this property.

    Declaration

    Objective-C

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

    Swift

    var openDocumentActionInNewTab: Bool { get set }
  • Updates the frame of the tabbed bar. It is not usually necessary to call this, but do so if the navigation bar height changes, for example by setting a prompt while the tabbed bar is visible. If the navigation bar has just started animating, this will animate the tabbed bar alongside.

    Declaration

    Objective-C

    - (void)updateTabbedBarFrameAnimated:(BOOL)animated;

    Swift

    func updateTabbedBarFrame(animated: Bool)
  • A Boolean value that determines whether the user can close documents. Use of this property should be replaced with use of closeMode. YES corresponds to PSPDFTabbedViewControllerCloseModeOnlySelectedTab. NO corresponds to PSPDFTabbedViewControllerCloseModeDisabled.

    Declaration

    Objective-C

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

    Swift

    var allowsClosingDocuments: Bool { get set }