---
title: titleView
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uinavigationitem/titleview
---

# titleView

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

## Declaration

```swift
var titleView: UIView? { get set }
```

## Discussion

Discussion If this property value is nil, the navigation item’s title is displayed in the center of the navigation bar when the receiver is the top item. If you set this property to a custom title, it is displayed instead of the title. Custom views can contain buttons. Use the init(type:) method in UIButton class to add buttons to your custom view in the style of the navigation bar. Custom title views are centered on the navigation bar and may be resized to fit. The default value is nil.

## See Also

### Specifying custom views

- [centerItemGroups](uikit/uinavigationitem/centeritemgroups.md)
- [leadingItemGroups](uikit/uinavigationitem/leadingitemgroups.md)
- [trailingItemGroups](uikit/uinavigationitem/trailingitemgroups.md)
- [pinnedTrailingGroup](uikit/uinavigationitem/pinnedtrailinggroup.md)
- [subtitleView](uikit/uinavigationitem/subtitleview.md)
- [largeSubtitleView](uikit/uinavigationitem/largesubtitleview.md)
- [leftBarButtonItems](uikit/uinavigationitem/leftbarbuttonitems.md)
- [leftBarButtonItem](uikit/uinavigationitem/leftbarbuttonitem.md)
- [rightBarButtonItems](uikit/uinavigationitem/rightbarbuttonitems.md)
- [rightBarButtonItem](uikit/uinavigationitem/rightbarbuttonitem.md)
- [setLeftBarButtonItems(_:animated:)](uikit/uinavigationitem/setleftbarbuttonitems(_:animated:).md)
- [setLeftBarButton(_:animated:)](uikit/uinavigationitem/setleftbarbutton(_:animated:).md)
- [setRightBarButtonItems(_:animated:)](uikit/uinavigationitem/setrightbarbuttonitems(_:animated:).md)
- [setRightBarButton(_:animated:)](uikit/uinavigationitem/setrightbarbutton(_:animated:).md)
