Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Navigation Title in SwiftUI #109

Open
M-I-N opened this issue Apr 13, 2023 · 2 comments
Open

Change Navigation Title in SwiftUI #109

M-I-N opened this issue Apr 13, 2023 · 2 comments

Comments

@M-I-N
Copy link

M-I-N commented Apr 13, 2023

In SwiftUI there is no straightforward way to customize the title for the Acknowledgment List view.
It would be nice to have an option to pass in the navigation title.

@M-I-N
Copy link
Author

M-I-N commented Apr 13, 2023

For now, one hacky way is to provide a .toolbar along with the AcknowListSwiftUIView at the time of setting it up as a destination of a NavigationLink.

Here is a sample:

struct ContentView: View {
    var body: some View {
        NavigationStack {
            VStack {
                NavigationLink("Show Acknowledgements") {
                    AcknowListSwiftUIView(acknowledgements: [])
                        .toolbar {
                            ToolbarItem(placement: .principal) {
                                Text("3rd Party Libraries")
                            }
                        }
                }
            }
            .navigationTitle("My App")
        }
    }
}

@vtourraine
Copy link
Owner

That’s a very good observation. Anyone got a suggestion on how to address it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants