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 theaction
parameter will be called on thetarget
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 thestackView
as its custom view.Use the
barButton
property to create aUIBarButtonItem
with thestackView
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 thestackView
as its custom view. -
A computed property that returns a
UIView
with thestackView
as its content.Use the
buttonView
property to create aUIView
with thestackView
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 thestackView
as its content. -
Initializes a new
GiniBarButton
object with the specified button type.Use the
init(ofType:)
initializer to create a newGiniBarButton
object with the specifiedBarButtonType
. TheBarButtonType
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.