Instance Method

setLeftBarButton(_:animated:)

Sets the custom bar button item, optionally animating the transition to the new item.

Declaration

func setLeftBarButton(_ item: UIBarButtonItem?, animated: Bool)

Parameters

item

A custom bar item to display on the left side of the navigation bar.

animated

Specify true to animate the transition to the custom bar item when this item is the top item. Specify false to set the item immediately without animating the change.

Discussion

If two navigation items have the same custom left or right bar button items, those bar button items remain stationary during the transition when the navigation item is pushed or popped.

See Also

Customizing Views

var titleView: UIView?

A custom view displayed in the center of the navigation bar when the receiver is the top item.

var leftBarButtonItems: [UIBarButtonItem]?

An array of custom bar button items to display on the left (or leading) side of the navigation bar when the receiver is the top navigation item.

var leftBarButtonItem: UIBarButtonItem?

A custom bar button item displayed on the left (or leading) edge of the navigation bar when the receiver is the top navigation item.

var rightBarButtonItems: [UIBarButtonItem]?

An array of custom bar button items to display on the right (or trailing) side of the navigation bar when the receiver is the top navigation item.

var rightBarButtonItem: UIBarButtonItem?

A custom bar button item displayed on the right (or trailing) edge of the navigation bar when the receiver is the top navigation item.

func setLeftBarButtonItems([UIBarButtonItem]?, animated: Bool)

Sets the left bar button items, optionally animating the transition to the new items.

func setRightBarButtonItems([UIBarButtonItem]?, animated: Bool)

Sets the right bar button items, optionally animating the transition to the new items.

func setRightBarButton(UIBarButtonItem?, animated: Bool)

Sets the custom bar button item, optionally animating the transition to the view.