FUIBarButtonItem
@MainActor
open class FUIBarButtonItem : UIBarButtonItem
FUIBarButtonItem is an enhanced UIBarButtonItem to provide a way to specify the
image to be displayed based on the state when title is nil or empty.
For now, only normal and disabled states are used.
FUIBarButtonItem also provides a few convenience init()s to return a newly initialized SAPFiori Style UIBarButtonItem. It has the SAPFiori styles, font & color for title and icon, .quaternaryFill background color for .highlighted state, and a minimum 44x44 touch area.
-
Sets the image for the specified control state.
Setting the
imageproperty is the same as setting the image for the.normalstate.Declaration
Swift
@MainActor public func setImage(_ image: UIImage?, for state: FUIControlState) -
Initializes a new SAPFiori Style
UIBarButtonItemusing the specified image and other properties.Declaration
Swift
@MainActor public convenience init(image: UIImage?, target: AnyObject?, action: Selector?)Parameters
imageThe item’s image. If nil, an image is not displayed. The images displayed on the bar are derived from this image. If this image is too large to fit on the bar, it is scaled to fit. Typically, the size of a toolbar and navigation bar image is 20 x 20 points. The alpha values in the source image are used to create the images—opaque values are ignored.
targetThe object that receives the action message.
actionThe action to send to the target when this item is selected.
Return Value
A newly initialized SAPFiori Style
UIBarButtonItemwith the specified properties. -
Initializes a new SAPFiori Style
UIBarButtonItemusing the specified images and other properties.Declaration
Swift
@MainActor public convenience init(image: UIImage?, landscapeImagePhone: UIImage?, target: AnyObject?, action: Selector?)Parameters
imageThe item’s image. If nil, an image is not displayed.
landscapeImagePhoneThe image to be used for the item in landscape bars in the
UIUserInterfaceIdiomPhoneidiom.targetThe object that receives the action message.
actionThe action to send to the target when this item is selected.
Return Value
A new SAPFiori Style
UIBarButtonIteminitialized to use using the specified images and other properties -
Initializes a new SAPFiori Style
UIBarButtonItemusing the specified title and other properties.Declaration
Swift
@MainActor public convenience init(title: String?, target: AnyObject?, action: Selector?)Parameters
titleThe item’s title. If nil, a title is not displayed.
targetThe object that receives the action message.
actionThe action to send to the target when this item is selected.
Return Value
A newly initialized SAPFiori Style
UIBarButtonItemwith the specified properties. -
Initializes a new SAPFiori Style
UIBarButtonItemusing the specified custom view.The bar button item created by this method does not call the action method of its target in response to user interactions. Instead, the bar button item expects the specified custom view to handle any user interactions and provide an appropriate response.
Declaration
Swift
@MainActor public convenience init(customView: UIView)Parameters
customViewA custom view representing the item.
Return Value
A newly initialized SAPFiori Style
UIBarButtonItemwith the specified custom view.