I’m new to SwiftUI, and I found this tool that solves the following problem: https://github.com/markvanwijnen/NavigationBarLargeTitleItems
Here’s an example of how to use it:
import SwiftUI
import NavigationBarLargeTitleItems
struct ContentView: View {
var body: some View {
NavigationView {
ScrollView {
ForEach(1 ... 50, id: \.self) { index in
Text("Index: \(index)")
}
.frame(maxWidth: .infinity)
}
.navigationTitle("Large title")
.navigationBarLargeTitleItems(trailing: /* your navigation link or button */)
}
}
}