<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UINavigationItem",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UINavigationItem"
  },
  "title" : "UINavigationItem"
}
-->

# UINavigationItem

The items that a navigation bar displays when the associated view controller is visible.

```
@MainActor class UINavigationItem
```

## Overview

When building a navigation interface, each view controller that you push onto the navigation stack must have a [`UINavigationItem`](/documentation/UIKit/UINavigationItem) object that contains the buttons and views you want to display in the navigation bar. The managing [`UINavigationController`](/documentation/UIKit/UINavigationController) object uses the navigation items of the topmost two view controllers to populate the navigation bar with content.

A navigation item always reflects information about its associated view controller. The navigation item must provide a title to display when the view controller is topmost on the navigation stack. The item can also contain additional buttons to display on the right (or trailing) side of the navigation bar. You can specify buttons and views to display on the left (or leading) side of the toolbar using the [`leftBarButtonItems`](/documentation/UIKit/UINavigationItem/leftBarButtonItems) property, but the navigation controller displays those buttons only when space is available.

To convey additional information about the view that a navigation item represents, use the [`subtitle`](/documentation/UIKit/UINavigationItem/subtitle) property. For example, in a view controller that displays a list of messages, you could use the `subtitle` to indicate the number of unread messages or the last time the app fetched messages. To apply text styles to a navigation item’s title or subtitle, use the [`attributedTitle`](/documentation/UIKit/UINavigationItem/attributedTitle-25fxb), [`attributedSubtitle`](/documentation/UIKit/UINavigationItem/attributedSubtitle-wrjk), and [`largeAttributedSubtitle`](/documentation/UIKit/UINavigationItem/largeAttributedSubtitle-4z2gx) properties.

The [`backBarButtonItem`](/documentation/UIKit/UINavigationItem/backBarButtonItem) property of a navigation item reflects the Back button you want to display when the current view controller is just below the topmost view controller. The Back button doesn’t appear when the current view controller is topmost.

When specifying buttons for a navigation item, you must use [`UIBarButtonItem`](/documentation/UIKit/UIBarButtonItem) objects. If you want to display custom views in the navigation bar, you must wrap those views inside a [`UIBarButtonItem`](/documentation/UIKit/UIBarButtonItem) object before adding them to the navigation item.

## Topics

### Initializing an item

[`init(title: String)`](/documentation/UIKit/UINavigationItem/init(title:))

Creates a navigation item with the specified title.

[`init?(coder: NSCoder)`](/documentation/UIKit/UINavigationItem/init(coder:))

Creates a navigation item from data in an unarchiver.

### Configuring the title

[`var title: String?`](/documentation/UIKit/UINavigationItem/title)

The navigation item’s title that displays in the navigation bar.

[`var attributedTitle: AttributedString?`](/documentation/UIKit/UINavigationItem/attributedTitle-25fxb)

[`@property (nonatomic, copy, nullable) NSAttributedString * attributedTitle;`](/documentation/UIKit/UINavigationItem/attributedTitle-9l8p2)

An attributed string that is rendered as the title in the navigation bar.

[`var largeTitle: String?`](/documentation/UIKit/UINavigationItem/largeTitle)

String to be used as the large title.

[`var largeTitleDisplayMode: UINavigationItem.LargeTitleDisplayMode`](/documentation/UIKit/UINavigationItem/largeTitleDisplayMode-swift.property)

The mode for displaying the title of the navigation bar.

[`enum LargeTitleDisplayMode`](/documentation/UIKit/UINavigationItem/LargeTitleDisplayMode-swift.enum)

Constants that indicate how to size the title of this item.

### Configuring the subtitle

[`var subtitle: String?`](/documentation/UIKit/UINavigationItem/subtitle)

A string to display as the subtitle in the navigation bar.

[`var attributedSubtitle: AttributedString?`](/documentation/UIKit/UINavigationItem/attributedSubtitle-wrjk)

[`@property (nonatomic, copy, nullable) NSAttributedString * attributedSubtitle;`](/documentation/UIKit/UINavigationItem/attributedSubtitle-4474c)

An attributed string to display as the subtitle in the navigation bar.

[`var largeSubtitle: String?`](/documentation/UIKit/UINavigationItem/largeSubtitle)

String to be rendered below the large title.

[`var largeAttributedSubtitle: AttributedString?`](/documentation/UIKit/UINavigationItem/largeAttributedSubtitle-4z2gx)

[`@property (nonatomic, copy, nullable) NSAttributedString * largeAttributedSubtitle;`](/documentation/UIKit/UINavigationItem/largeAttributedSubtitle-2c0pk)

An attributed string to be rendered below the large title.

### Configuring the Back button

[`var backBarButtonItem: UIBarButtonItem?`](/documentation/UIKit/UINavigationItem/backBarButtonItem)

The bar button item for adding a Back button to the navigation bar.

[`var backButtonTitle: String?`](/documentation/UIKit/UINavigationItem/backButtonTitle)

The custom title of the Back button.

[`var backButtonDisplayMode: UINavigationItem.BackButtonDisplayMode`](/documentation/UIKit/UINavigationItem/backButtonDisplayMode-swift.property)

The display mode of the Back button.

[`enum BackButtonDisplayMode`](/documentation/UIKit/UINavigationItem/BackButtonDisplayMode-swift.enum)

Constants that describe the display modes of the Back button.

[`var hidesBackButton: Bool`](/documentation/UIKit/UINavigationItem/hidesBackButton)

A Boolean value that determines whether the navigation item hides the Back button.

[`func setHidesBackButton(Bool, animated: Bool)`](/documentation/UIKit/UINavigationItem/setHidesBackButton(_:animated:))

Hides or shows the Back button, optionally animating the transition.

[`var backAction: UIAction?`](/documentation/UIKit/UINavigationItem/backAction)

The back action for the navigation bar.

### Specifying the navigation style

[`var style: UINavigationItem.ItemStyle`](/documentation/UIKit/UINavigationItem/style)

A style that determines how the content of the navigation item lays out in the navigation bar.

[`enum ItemStyle`](/documentation/UIKit/UINavigationItem/ItemStyle)

Constants that determine how the content of the navigation item lays out in the navigation bar.

### Specifying custom views

[`var centerItemGroups: [UIBarButtonItemGroup]`](/documentation/UIKit/UINavigationItem/centerItemGroups)

Customizable item groups to display in the center section of the navigation bar.

[`var leadingItemGroups: [UIBarButtonItemGroup]`](/documentation/UIKit/UINavigationItem/leadingItemGroups)

Item groups to display in the leading section of the navigation bar.

[`var trailingItemGroups: [UIBarButtonItemGroup]`](/documentation/UIKit/UINavigationItem/trailingItemGroups)

Item groups to display in the trailing section of the navigation bar.

[`var pinnedTrailingGroup: UIBarButtonItemGroup?`](/documentation/UIKit/UINavigationItem/pinnedTrailingGroup)

The item group to display on the trailing edge of the navigation bar, on the trailing side of the overflow and search items.

[`var titleView: UIView?`](/documentation/UIKit/UINavigationItem/titleView)

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

[`var subtitleView: UIView?`](/documentation/UIKit/UINavigationItem/subtitleView)

A custom view to display below the title in the navigation bar.

[`var largeSubtitleView: UIView?`](/documentation/UIKit/UINavigationItem/largeSubtitleView)

A custom view to display below the large title.

[`var leftBarButtonItems: [UIBarButtonItem]?`](/documentation/UIKit/UINavigationItem/leftBarButtonItems)

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

[`var leftBarButtonItem: UIBarButtonItem?`](/documentation/UIKit/UINavigationItem/leftBarButtonItem)

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

[`var rightBarButtonItems: [UIBarButtonItem]?`](/documentation/UIKit/UINavigationItem/rightBarButtonItems)

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

[`var rightBarButtonItem: UIBarButtonItem?`](/documentation/UIKit/UINavigationItem/rightBarButtonItem)

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

[`func setLeftBarButtonItems([UIBarButtonItem]?, animated: Bool)`](/documentation/UIKit/UINavigationItem/setLeftBarButtonItems(_:animated:))

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

[`func setLeftBarButton(UIBarButtonItem?, animated: Bool)`](/documentation/UIKit/UINavigationItem/setLeftBarButton(_:animated:))

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

[`func setRightBarButtonItems([UIBarButtonItem]?, animated: Bool)`](/documentation/UIKit/UINavigationItem/setRightBarButtonItems(_:animated:))

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

[`func setRightBarButton(UIBarButtonItem?, animated: Bool)`](/documentation/UIKit/UINavigationItem/setRightBarButton(_:animated:))

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

### Getting and setting properties

[`var prompt: String?`](/documentation/UIKit/UINavigationItem/prompt)

A single line of text that displays at the top of the navigation bar.

[`var leftItemsSupplementBackButton: Bool`](/documentation/UIKit/UINavigationItem/leftItemsSupplementBackButton)

A Boolean value that indicates whether the left items display in addition to the Back button.

### Overriding the navigation bar’s appearance settings

[`var standardAppearance: UINavigationBarAppearance?`](/documentation/UIKit/UINavigationItem/standardAppearance)

The appearance settings for a standard-height navigation bar.

[`var compactAppearance: UINavigationBarAppearance?`](/documentation/UIKit/UINavigationItem/compactAppearance)

The appearance settings for a compact-height navigation bar.

[`var scrollEdgeAppearance: UINavigationBarAppearance?`](/documentation/UIKit/UINavigationItem/scrollEdgeAppearance)

The appearance settings for a standard-height navigation bar when the edge of scrollable content aligns with the edge of the navigation bar.

[`var compactScrollEdgeAppearance: UINavigationBarAppearance?`](/documentation/UIKit/UINavigationItem/compactScrollEdgeAppearance)

The appearance settings for a compact-height navigation bar when the edge of scrollable content aligns with the edge of the navigation bar.

### Integrating search into your interface

[`var searchController: UISearchController?`](/documentation/UIKit/UINavigationItem/searchController)

The search controller to integrate into your navigation interface.

[`var hidesSearchBarWhenScrolling: Bool`](/documentation/UIKit/UINavigationItem/hidesSearchBarWhenScrolling)

A Boolean value that indicates whether the app hides the integrated search bar when scrolling any underlying content.

[`var searchBarPlacement: UINavigationItem.SearchBarPlacement`](/documentation/UIKit/UINavigationItem/searchBarPlacement-swift.property)

The placement of the search bar in the navigation bar.

[`var preferredSearchBarPlacement: UINavigationItem.SearchBarPlacement`](/documentation/UIKit/UINavigationItem/preferredSearchBarPlacement)

The preferred placement of the search bar in the navigation bar.

[`enum SearchBarPlacement`](/documentation/UIKit/UINavigationItem/SearchBarPlacement-swift.enum)

Constants that determine where the search bar appears in the navigation bar.

[`var searchBarPlacementAllowsExternalIntegration: Bool`](/documentation/UIKit/UINavigationItem/searchBarPlacementAllowsExternalIntegration)

A Boolean value that indicates whether an alternate object may integrate the search bar somewhere other than the navigation bar or toolbar.

[`var searchBarPlacementAllowsToolbarIntegration: Bool`](/documentation/UIKit/UINavigationItem/searchBarPlacementAllowsToolbarIntegration)

A Boolean value that indicates whether the system can place the search bar among other toolbar items on iPhone.

[`var searchBarPlacementBarButtonItem: UIBarButtonItem`](/documentation/UIKit/UINavigationItem/searchBarPlacementBarButtonItem)

An item you use to control the placement of the search bar in a toolbar on iPhone.

### Supporting navigation bar customization

[`var customizationIdentifier: String?`](/documentation/UIKit/UINavigationItem/customizationIdentifier)

A globally unique string that enables user customization of the navigation bar layout.

### Working with the overflow menu

[`var additionalOverflowItems: UIDeferredMenuElement?`](/documentation/UIKit/UINavigationItem/additionalOverflowItems)

Additional items to present in the overflow menu.

[`var overflowPresentationSource: (any UIPopoverPresentationControllerSourceItem)?`](/documentation/UIKit/UINavigationItem/overflowPresentationSource)

The item you can use as an anchor to present a custom UI from the overflow menu button.

### Customizing the title menu

[`var titleMenuProvider: (([UIMenuElement]) -> UIMenu?)?`](/documentation/UIKit/UINavigationItem/titleMenuProvider)

A closure that generates the navigation item’s title menu.

[`var documentProperties: UIDocumentProperties?`](/documentation/UIKit/UINavigationItem/documentProperties)

An object that provides the document header for the title menu.

[`class UIDocumentProperties`](/documentation/UIKit/UIDocumentProperties)

Information that UIKit uses to generate a document header for a navigation item’s title menu.

### Renaming documents

[`var renameDelegate: (any UINavigationItemRenameDelegate)?`](/documentation/UIKit/UINavigationItem/renameDelegate-8jiuf)

The delegate for renaming the navigation item.

[`protocol UINavigationItemRenameDelegate`](/documentation/UIKit/UINavigationItemRenameDelegate-5j4ws)

Methods an object implements to rename a navigation item.

### Renaming documents

[`@property (nonatomic, weak, readwrite) id<UINavigationItemRenameDelegate> renameDelegate;`](/documentation/UIKit/UINavigationItem/renameDelegate-o32h)

The delegate for renaming the navigation item.

[`@protocol UINavigationItemRenameDelegate <NSObject>`](/documentation/UIKit/UINavigationItemRenameDelegate-96g5t)

Methods an object implements to rename a navigation item.

### Instance Properties

[`var navigationBarMinimization: UIBarMinimization`](/documentation/UIKit/UINavigationItem/navigationBarMinimization-1kj9z)

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Sendable`](/documentation/Swift/Sendable)

[`NSCoding`](/documentation/Foundation/NSCoding)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)