1

I'm very new to Xcode and SwiftUI and I was wondering if anybody knows how to add multiple navigationBarTitle in SwiftUI such as the one I found in Apple news. I wanna be able to add my main title for the page but then also supply like a date. Would love any suggestions someone has thank you :) enter image description here

Luke
  • 105
  • 7
  • Seems a similar question https://stackoverflow.com/questions/59825965/swiftui-multiline-text-in-a-navigationview-title – SamB Oct 12 '21 at 06:38

1 Answers1

0

Navigation bar in SwiftUI can be customized. Use code like below:

        NavigationView { 
            Text("Hello, world!")
                .navigationBarTitleDisplayMode(.inline)
                .toolbar {
                    ToolbarItem(placement: .navigationBarLeading) {
                        VStack {
                            Text("Title").font(.largeTitle)
                            Text("Subtitle").font(.subheadline)
                        }
                    }
                }
        }

This will make the navigation bar show like this: enter image description here

Turtleeeeee
  • 171
  • 7