PTDocumentTabBar


@interface PTDocumentTabBar
    : UIView <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>

The PTDocumentTabBar class displays the a set of tabs in a horizontally scrollable layout.

  • The tab manager used to track the list of tabs and the selected tab.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite, nullable)
        PTDocumentTabManager *tabManager;

    Swift

    var tabManager: PTDocumentTabManager? { get set }
  • The view to be displayed behind all other content.

    The default background view is an empty UIToolbar.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite, nullable) UIView *backgroundView;

    Swift

    var backgroundView: UIView? { get set }
  • The collection view that displays the tabs from the tabManager as selectable views.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite)
        UICollectionView *_Nonnull collectionView;

    Swift

    var collectionView: UICollectionView { get set }
  • The view to be displayed at the leading end of the tab bar.

    The default value of this property is nil.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite, nullable) UIView *leadingView;

    Swift

    var leadingView: UIView? { get set }
  • The view to be displayed at the trailing end of the tab bar.

    The default value of this property is nil.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite, nullable) UIView *trailingView;

    Swift

    var trailingView: UIView? { get set }
  • Tabs will fill the available space in the tab bar and as more tabs are displayed, their widths are compressed up to this minimum value. When the width of tabs reaches this value then the collectionView will become (horizontally) scrollable.

    The default value of this property is 120pts.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        CGFloat minimumTabWith;

    Swift

    var minimumTabWith: CGFloat { get set }
  • Whether a tab is currently being interactively moved.

    The default value of this property is NO.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isInteractivelyMoving) BOOL interactivelyMoving;

    Swift

    var isInteractivelyMoving: Bool { get set }
  • The index of the currently selected tab.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        NSUInteger selectedIndex;

    Swift

    var selectedIndex: UInt { get set }
  • Sets the index of the currently selected tab.

    Declaration

    Objective-C

    - (void)setSelectedIndex:(NSUInteger)selectedIndex animated:(BOOL)animated;

    Swift

    func setSelectedIndex(_ selectedIndex: UInt, animated: Bool)
  • Removes the tab at the specified index.

    Declaration

    Objective-C

    - (void)removeTabAtIndex:(NSUInteger)index animated:(BOOL)animated;

    Swift

    func removeTab(at index: UInt, animated: Bool)
  • Reloads the tabs displayed by this view.

    Declaration

    Objective-C

    - (void)reloadItems;

    Swift

    func reloadItems()