Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between navigationBarTitle and navigationTitle in SwiftUI 2.0? [duplicate]

Tags:

swiftui

I don't understand the exact difference between navigationBarTitle() and navigationTitle(). Can someone please explain when to use which?

like image 216
G. Marc Avatar asked Dec 22 '22 16:12

G. Marc


1 Answers

The navigationTitle is just SwiftUI 2.0 replacement for deprecated SwiftUI 1.0 navigationBarTitle

@available(iOS, introduced: 13.0, deprecated: 100000.0, renamed: "navigationTitle(_:)")
@available(macOS, unavailable)
@available(tvOS, introduced: 13.0, deprecated: 100000.0, renamed: "navigationTitle(_:)")
@available(watchOS, introduced: 6.0, deprecated: 100000.0, renamed: "navigationTitle(_:)")
public func navigationBarTitle(_ title: Text) -> some View
like image 133
Asperi Avatar answered Jan 19 '23 01:01

Asperi