Initializer

init(title:style:target:action:)

Initializes a new item using the specified title and other properties.

Declaration

convenience init(title: String?, style: UIBarButtonItem.Style, target: Any?, action: Selector?)

Parameters

title

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

style

The style of the item. One of the constants defined in UIBarButtonItem.Style.

target

The object that receives the action message.

action

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

Return Value

Newly initialized item with the specified properties.

See Also

Initializing an Item

init(barButtonSystemItem: UIBarButtonItem.SystemItem, target: Any?, action: Selector?)

Initializes a new item containing the specified system item.

init(customView: UIView)

Initializes a new item using the specified custom view.

init(image: UIImage?, style: UIBarButtonItem.Style, target: Any?, action: Selector?)

Initializes a new item using the specified image and other properties.

init()

Initializes the bar button item to its default state.