FUIBarButtonItem

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 image property is the same as setting the image for the .normal state.

    Declaration

    Swift

    public func setImage(_ image: UIImage?, for state: FUIControlState)
  • Initializes a new SAPFiori Style UIBarButtonItem using the specified image and other properties.

    Declaration

    Swift

    public convenience init(image: UIImage?, target: AnyObject?, action: Selector?)

    Parameters

    image

    The 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.

    target

    The object that receives the action message.

    action

    The action to send to the target when this item is selected.

    Return Value

    A newly initialized SAPFiori Style UIBarButtonItem with the specified properties.

  • Initializes a new SAPFiori Style UIBarButtonItem using the specified images and other properties.

    Declaration

    Swift

    public convenience init(image: UIImage?, landscapeImagePhone: UIImage?, target: AnyObject?, action: Selector?)

    Parameters

    image

    The item’s image. If nil, an image is not displayed.

    landscapeImagePhone

    The image to be used for the item in landscape bars in the UIUserInterfaceIdiomPhone idiom.

    target

    The object that receives the action message.

    action

    The action to send to the target when this item is selected.

    Return Value

    A new SAPFiori Style UIBarButtonItem initialized to use using the specified images and other properties

  • Initializes a new SAPFiori Style UIBarButtonItem using the specified title and other properties.

    Declaration

    Swift

    public convenience init(title: String?, target: AnyObject?, action: Selector?)

    Parameters

    title

    The item’s title. If nil, a title is not displayed.

    target

    The object that receives the action message.

    action

    The action to send to the target when this item is selected.

    Return Value

    A newly initialized SAPFiori Style UIBarButtonItem with the specified properties.

  • Initializes a new SAPFiori Style UIBarButtonItem using 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

    public convenience init(customView: UIView)

    Parameters

    customView

    A custom view representing the item.

    Return Value

    A newly initialized SAPFiori Style UIBarButtonItem with the specified custom view.