What is the difference between ①navigationBarTitleDisplayMode and ②toolbarTitleDisplayMode when using them with SwiftUI’s navigationTitle?
It appears that .inlineLarge only works with the latter (②), and the toolbarTitleMenu option for adding a Menu to the title also adopts the name of the latter (②), so I thought that Apple might be planning to transition from ① to ②. However, the API name for navigationTitle has remained the same, and no toolbarTitle API exists.
I am curious why Apple maintains these two APIs without deprecating one. If anyone has any insights or speculations, I would appreciate your thoughts. Is there a difference between these two codes that I may have overlooked?
struct ContentView: View {
var body: some View {
NavigationStack {
Text("Hello, world!")
.navigationTitle("Hello")
//(1).navigationBarTitleDisplayMode(.inline)
//(2).toolbarTitleDisplayMode(.inlineLarge)
}
}
}
Additionally, I wonder if this is related to the recent deprecation of navigationBarTitle.