Bar
The bar is responsible for conveying the current page position of a TabmanViewController, and providing the user with the ability to interact with the page view controller indirectly. In Tabman, this comes in the form of TMBar, a protocol that is restricted to UIView types. TMBar instances can be added to a TabmanViewController and are then internally managed by the view controller.
The default TMBar provided in Tabman is the TMBarView, a flexible view which contains the following core components:
- Layout (
TMBarLayout) - responsible for dictating the layout and display of the bar. - Buttons (
TMBarButton) - interactable views that directly map to each bar item. - Indicator (
TMBarIndicator) - view that indicates the currently active item.
These components are defined with generic type constraints on TMBarView, providing a huge amount of customization and flexibility. In all likelyhood you will not have to create your own TMBar but if required it is absolutely possible.
-
TMBaris a protocol that is constrained toUIViewtypes. Conforming view types can be added to and displayed in aTabmanViewController.TMBaris expected to display aTMBarItemcollection provided by a data source visually in some form, and also respond to the current page position.The default implementation of
TMBarin Tabman isTMBarView.Declaration
Swift
public protocol TMBar : UIView, BaseTMBar -
TMBarViewis the default Tabman implementation ofTMBar. AUIViewthat contains aTMBarLayoutwhich displays a collection ofTMBarButton, and also aTMBarIndicator. The types of these three components are defined by constraints in theTMBarViewtype definition.Declaration
Swift
open class TMBarView<Layout, Button, Indicator> : UIView, TMTransitionStyleable, TMBarLayoutParent where Layout : TMBarLayout, Button : TMBarButton, Indicator : TMBarIndicatorextension TMBarView: TMBar -
Definition of an item that can be displayed in a
TMBar.Properties of a
TMBarItemableare optionally displayed in aTMBardepending on the layout / configuration.Tabman adds extensions to UIKit components to natively support
TMBarItemable, such asUINavigationItemandUITabBarItem. Therefore for example, simply returning aUIViewControllernavigationItemas aTMBarItemableis fully supported.Declaration
Swift
public protocol TMBarItemable : AnyObject -
Default
TMBarItemablethat can be displayed in aTMBar.Declaration
Swift
open class TMBarItem : TMBarItemable -
Data source to a
TMBarthat is primarily responsible for providing a bar with contents.Declaration
Swift
public protocol TMBarDataSource : AnyObject -
Delegate to a
TMBarthat is primarily responsible for handling user interaction within the bar.Declaration
Swift
public protocol TMBarDelegate : AnyObject -
Bar which mimicks the appearance of a UIKit
UINavigationBar/UITabBar.Contains an internal
TMBarand forwards on all bar responsibility to this instance.Declaration
-
Bar which can be hidden using animated transitions.
Supports manual show/hide triggering and also automatic triggers such as time.
Declaration
View on GitHub
Install in Dash
Bar Reference