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.
-
TMBar
is a protocol that is constrained toUIView
types. Conforming view types can be added to and displayed in aTabmanViewController
.TMBar
is expected to display aTMBarItem
collection provided by a data source visually in some form, and also respond to the current page position.The default implementation of
TMBar
in Tabman isTMBarView
.Declaration
Swift
public protocol TMBar : UIView, BaseTMBar
-
TMBarView
is the default Tabman implementation ofTMBar
. AUIView
that contains aTMBarLayout
which displays a collection ofTMBarButton
, and also aTMBarIndicator
. The types of these three components are defined by constraints in theTMBarView
type definition.Declaration
Swift
open class TMBarView<Layout, Button, Indicator> : UIView, TMTransitionStyleable, TMBarLayoutParent where Layout : TMBarLayout, Button : TMBarButton, Indicator : TMBarIndicator
extension TMBarView: TMBar
-
Definition of an item that can be displayed in a
TMBar
.Properties of a
TMBarItemable
are optionally displayed in aTMBar
depending on the layout / configuration.Tabman adds extensions to UIKit components to natively support
TMBarItemable
, such asUINavigationItem
andUITabBarItem
. Therefore for example, simply returning aUIViewController
navigationItem
as aTMBarItemable
is fully supported.Declaration
Swift
public protocol TMBarItemable : AnyObject
-
Default
TMBarItemable
that can be displayed in aTMBar
.Declaration
Swift
open class TMBarItem : TMBarItemable
-
Data source to a
TMBar
that is primarily responsible for providing a bar with contents.Declaration
Swift
public protocol TMBarDataSource : AnyObject
-
Delegate to a
TMBar
that 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
TMBar
and 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