TMBar
public protocol TMBar : UIView, BaseTMBar
TMBar
is a protocol that is constrained to UIView
types. Conforming view types can be added to
and displayed in a TabmanViewController
.
TMBar
is expected to display a TMBarItem
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 is TMBarView
.
-
Object that acts as a data source to the bar.
Declaration
Swift
var dataSource: TMBarDataSource? { get set }
-
Object that acts as a delegate to the bar.
Declaration
Swift
var delegate: TMBarDelegate? { get set }
-
Items that are currently displayed in the bar.
Declaration
Swift
var items: [TMBarItemable]? { get }
-
Reload the data within the bar.
Declaration
Swift
func reloadData(at indexes: ClosedRange<Int>, context: TMBarReloadContext)
Parameters
indexes
The indexes to reload.
context
The context for the reload.
-
Update the display in the bar for a particular page position.
Declaration
Swift
func update(for position: CGFloat, capacity: Int, direction: TMBarUpdateDirection, animation: TMAnimation)
Parameters
pagePosition
Position to display.
capacity
The capacity of the bar.
direction
Semantic direction of the update.
shouldAnimate
Whether the bar should animate the update.
-
hiding(trigger:)
Extension methodCreate a hideable bar.
Declaration
Swift
public func hiding(trigger: TMHidingBar.Trigger) -> TMHidingBar
Parameters
trigger
Trigger which causes the hide / show.
Return Value
Hiding bar.
-
systemBar()
Extension methodEmbed the bar in a ‘system’ bar that will mimick
UINavigationBar
andUITabBar
.Declaration
Swift
public func systemBar() -> TMSystemBar
Return Value
System bar.
-
ButtonBar
Extension methodThe default button bar, very reminiscent of the Android
FragmentPagerAdapter
. It consists of a horizontal layout containing label bar buttons, and a line indicator at the bottom.Declaration
Swift
public typealias ButtonBar = TMBarView<TMHorizontalBarLayout, TMLabelBarButton, TMLineBarIndicator>
-
TabBar
Extension methodiOS ‘UITabBar’ style bar, featuring a constrained horizontal layout, tab item bar buttons with a vertically aligned image and label, and no visible indicator.
Declaration
Swift
public typealias TabBar = TMBarView<TMConstrainedHorizontalBarLayout, TMTabItemBarButton, TMBarIndicator.None>
-
LineBar
Extension methodBar which features only a line indicator, and no buttons.
Declaration
Swift
public typealias LineBar = TMBarView<TMBarLayout.None, TMBarButton.None, TMLineBarIndicator>