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
indexesThe indexes to reload.
contextThe 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
pagePositionPosition to display.
capacityThe capacity of the bar.
directionSemantic direction of the update.
shouldAnimateWhether the bar should animate the update.
-
hiding(trigger:)Extension methodCreate a hideable bar.
Declaration
Swift
public func hiding(trigger: TMHidingBar.Trigger) -> TMHidingBarParameters
triggerTrigger which causes the hide / show.
Return Value
Hiding bar.
-
systemBar()Extension methodEmbed the bar in a ‘system’ bar that will mimick
UINavigationBarandUITabBar.Declaration
Swift
public func systemBar() -> TMSystemBarReturn Value
System bar.
-
ButtonBarExtension 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> -
TabBarExtension 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> -
LineBarExtension methodBar which features only a line indicator, and no buttons.
Declaration
Swift
public typealias LineBar = TMBarView<TMBarLayout.None, TMBarButton.None, TMLineBarIndicator>
View on GitHub
Install in Dash
TMBar Protocol Reference