TMBarButton

open class TMBarButton : UIControl

A button that appears in a bar and provides the interaction for initiating a page index update.

  • Selection state of the button.

    • unselected: Unselected - Current page index is not currently mapped to the button.
    • partial: Partially selected - Current page index is either arriving or departing from the mapped button.
    • selected: Selected - Current page index is mapped to the button.
    Declaration

    Swift

    public var selectionState: SelectionState { get set }
  • Initialize a bar button.

    Declaration

    Swift

    public required init(for item: TMBarItemable, intrinsicSuperview: UIView?)
    Parameters
    item

    Item to create the bar button for.

    intrinsicSuperview

    View that can be notified whenever any intrinsic layout changes occur.

  • Layout the Bar Button.

    Declaration

    Swift

    open func layout(in view: UIView)
    Parameters
    view

    The view to use as the root of the button.

  • Layout the badge view for the button.

    Declaration

    Swift

    open func layoutBadge(_ badge: TMBadgeView, in view: UIView)
    Parameters
    badge

    Badge view.

    view

    View to use for layout.

  • Populate the button with a bar item.

    Declaration

    Swift

    open func populate(for item: TMBarItemable)
    Parameters
    item

    Item to populate.

  • Update the button for a new selection state.

    Declaration

    Swift

    open func update(for selectionState: SelectionState)
    Parameters
    selectionState

    Selection state.

  • Button that is zero height and hidden.

    Use this if you do not want visible buttons in the bar.

    Declaration

    Swift

    public final class None : TMBarButton