79387464

Date: 2025-01-25 20:29:50
Score: 1
Natty:
Report link

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 */)
        }
    }
}
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: user29145211