TMBarItemable

public protocol TMBarItemable : AnyObject

Definition of an item that can be displayed in a TMBar.

Properties of a TMBarItemable are optionally displayed in a TMBar depending on the layout / configuration.

Tabman adds extensions to UIKit components to natively support TMBarItemable, such as UINavigationItem and UITabBarItem. Therefore for example, simply returning a UIViewController navigationItem as a TMBarItemable is fully supported.

  • Title of the item.

    Declaration

    Swift

    var title: String? { get set }
  • Image to display.

    Note

    If you want the image to be colored by tint colors when within a TMBar, you must use the .alwaysTemplate image rendering mode.

    Warning

    The usage of this property is dependent on the type of TMBarButton within the bar.
    Declaration

    Swift

    var image: UIImage? { get set }
  • Image for the selected state.

    Warning

    The usage of this property is dependent on the type of TMBarButton within the bar.
    Declaration

    Swift

    var selectedImage: UIImage? { get set }
  • Badge value to display.

    Declaration

    Swift

    var badgeValue: String? { get set }
  • Returns a short description of the button.

    Declaration

    Swift

    var accessibilityLabel: String? { get set }
  • A brief description of the result of performing an action on the accessibility element, in a localized string.

    Declaration

    Swift

    var accessibilityHint: String? { get set }
  • setNeedsUpdate() Default implementation

    Inform the bar that the item has been updated.

    This will notify any button that is responsible for the item that it requires updating, and will call populate(for: item). The bar indicator position will also be reloaded to reflect any layout updates.

    Default Implementation
    Declaration

    Swift

    func setNeedsUpdate()