.navigationTitle()

iOS 14+

Sets the title in the navigation bar.

Navigation
Official Apple Documentation →
iOS User Coverage
97.1%
coverage

97.1% of iOS users can use this modifier

Version Compatibility
iOS 18.7
30.3% Supported
iOS 18.6
29.8% Supported
iOS 26.1
10.7% Supported
iOS 18.5
6.0% Supported
iOS 16.7
2.3% Supported
iOS 26.2
2.0% Supported
iOS 18.3
1.8% Supported
iOS 15.8
1.8% Supported
iOS 17.6
1.7% Supported
iOS 26.0
1.3% Supported

iOS 14+ required

Variants
.navigationTitle()

Basic navigationTitle modifier

Code Examples

Basic navigationTitle Usage

Apply the .navigationTitle() modifier to a view

Text("Hello, World!")
    .navigationTitle()
Using with Older iOS Versions

If your app supports iOS versions older than 14, you can use #available to conditionally apply this modifier:

if #available(iOS 14, *) {
    myView.navigationTitle()
} else {
    // Fallback for older iOS versions
    myView
}

Check the code examples above for specific #available patterns with this modifier.

Frequently Asked Questions

What iOS version is required for .navigationTitle()?

The .navigationTitle() modifier requires iOS 14 or later. This means 97.1% of current iOS users can use this modifier.

Can I use this if my app supports older iOS versions?

Yes! Use #available(iOS 14, *) to conditionally apply this modifier only on devices running iOS 14 or later, with a fallback for older versions.

How do I use .navigationTitle() in SwiftUI?

Apply the .navigationTitle() modifier to any SwiftUI view. Check the code examples above for usage patterns.

Where can I learn more?

Visit the official Apple documentation for detailed information.

Explore More SwiftUI Modifiers