GiniBarButton

public final class GiniBarButton

A custom navigation bar button that displays a stack of subviews.

Use the GiniBarButton class to create a custom toolbar button with a stack of subviews. This allows you to customize the appearance and behavior of the button by adding and configuring subviews within the stack view. The GiniBarButton class provides a convenient interface for creating a UIBarButtonItem with a custom view, and includes several helper methods for managing the subviews of the stack view.

  • Adds a tap gesture recognizer to the stack view with the specified target and action.

    Use the addAction(_ target: Any?, _ action: Selector) function to call the specified action. When the tap gesture is recognized, the action method specified by the action parameter will be called on the target object.

    Declaration

    Swift

    public func addAction(_ target: Any?, _ action: Selector)

    Parameters

    target

    The object that will handle the action message. If this parameter is nil, the action message will be sent to the first responder.

    action

    The action method to call on the target object when the tap gesture is recognized.

  • A computed property that returns a UIBarButtonItem with the stackView as its custom view.

    Use the barButton property to create a UIBarButtonItem with the stackView as its custom view. This allows you to customize the appearance and behavior of the button by adding and configuring subviews within the stack view.

    Declaration

    Swift

    public var barButton: UIBarButtonItem { get }

    Return Value

    A UIBarButtonItem object with the stackView as its custom view.

  • A computed property that returns a UIView with the stackView as its content.

    Use the buttonView property to create a UIView with the stackView as its content. This allows you to customize the appearance and behavior of the button by adding and configuring subviews within the stack view.

    Declaration

    Swift

    public var buttonView: UIView { get }

    Return Value

    A UIView object with the stackView as its content.

  • Initializes a new GiniBarButton object with the specified button type.

    Use the init(ofType:) initializer to create a new GiniBarButton object with the specified BarButtonType. The BarButtonType parameter determines the appearance and behavior of the button.

    Declaration

    Swift

    public init(ofType type: BarButtonType)

    Parameters

    type

    The BarButtonType that determines the appearance and behavior of the button.