PSPDFNavigationItem

Objective-C


@interface PSPDFNavigationItem : UINavigationItem

Swift

class NavigationItem : UINavigationItem

A navigation item that supports different values for certain properties for different view modes.

PSPDFNavigationItem enables you to assign left and right bar button items based on the view mode, so that every view mode can have different bar button items displayed in the navigation bar. This navigation item and the corresponding view controller ensure that displayed bar button items are are updated correctly when the view mode changes.

  • The value of the leftBarButtonItems property for the given view mode.

    Declaration

    Objective-C

    - (nullable NSArray<UIBarButtonItem *> *)leftBarButtonItemsForViewMode:
        (PSPDFViewMode)viewMode;

    Swift

    func leftBarButtonItems(for viewMode: ViewMode) -> [UIBarButtonItem]?
  • Set the custom value of the leftBarButtonItems property to use for the given vien mode, optionally animating the change.

    Note

    Using leftBarButtonItem, setLeftBarButtonItem(_:animated:), leftBarButtonItems or setLeftBarButtonItems(_:animated:) will set the value of the leftBarButtonItems property for all view modes, resetting any custom values that were previously set for each view mode.

    Declaration

    Objective-C

    - (void)setLeftBarButtonItems:(nullable NSArray<UIBarButtonItem *> *)items
                      forViewMode:(PSPDFViewMode)viewMode
                         animated:(BOOL)animated;

    Swift

    func setLeftBarButtonItems(_ items: [UIBarButtonItem]?, for viewMode: ViewMode, animated: Bool)
  • The value of the rightBarButtonItems property for the given view mode.

    Declaration

    Objective-C

    - (nullable NSArray<UIBarButtonItem *> *)rightBarButtonItemsForViewMode:
        (PSPDFViewMode)viewMode;

    Swift

    func rightBarButtonItems(for viewMode: ViewMode) -> [UIBarButtonItem]?
  • Set the custom value of the rightBarButtonItems property to use for the given view mode, optionally animating the change.

    Note

    Using rightBarButtonItem, setRightBarButtonItem(_:animated:), rightBarButtonItems or setRightBarButtonItems(_:animated:) will set the value of the rightBarButtonItems property for all view modes, resetting any custom values that were previously set for each view mode.

    Declaration

    Objective-C

    - (void)setRightBarButtonItems:(nullable NSArray<UIBarButtonItem *> *)items
                       forViewMode:(PSPDFViewMode)viewMode
                          animated:(BOOL)animated;

    Swift

    func setRightBarButtonItems(_ items: [UIBarButtonItem]?, for viewMode: ViewMode, animated: Bool)
  • The button that is used as the close button in presentation contexts.

    This property should always be set. The managing view controller takes care of showing or hiding this button as necessary.

    If you set this property to nil, you need to take care of the cases where the related view controller may be presented modally yourself.

    Note

    The closeBarButtonItem may be included in the leftBarButtonItems array, depending on whether the close button is currently visible or not. You should not use this property and instead use leftBarButtonItemsForViewMode:, which will never include the closeBarButtonItem.

    Declaration

    Objective-C

    @property (nonatomic, nullable) UIBarButtonItem *closeBarButtonItem;

    Swift

    var closeBarButtonItem: UIBarButtonItem? { get set }
  • The value of the title property for the given view mode.

    Declaration

    Objective-C

    - (nullable NSString *)titleForViewMode:(PSPDFViewMode)viewMode;

    Swift

    func title(for viewMode: ViewMode) -> String?

    Return Value

    The value of the title property for the given view mode.

  • Set the custom value of the title property to use for the given view mode.

    Note

    Setting the title property directly will set the default value which will be used if no custom value is set for a particular view mode.

    Declaration

    Objective-C

    - (void)setTitle:(nullable NSString *)title forViewMode:(PSPDFViewMode)viewMode;

    Swift

    func setTitle(_ title: String?, for viewMode: ViewMode)
  • The value of the leftItemsSupplementBackButton property to use for the given view mode.

    Declaration

    Objective-C

    - (BOOL)leftItemsSupplementBackButtonForViewMode:(PSPDFViewMode)viewMode;

    Swift

    func leftItemsSupplementBackButton(for viewMode: ViewMode) -> Bool
  • Set the custom value of the leftItemsSupplementBackButton property to use for the given view mode.

    Note

    Setting the leftItemsSupplementBackButton property directly will set the default value which will be used if no custom value is set for a particular view mode.

    Declaration

    Objective-C

    - (void)setLeftItemsSupplementBackButton:(BOOL)leftItemsSupplementBackButton
                                 forViewMode:(PSPDFViewMode)viewMode;

    Swift

    func setLeftItemsSupplementBackButton(_ leftItemsSupplementBackButton: Bool, for viewMode: ViewMode)