In iOS SwiftUI, How we can make a common layout for Navigation Bar. So we can use that in all project without re-write the same code.
We can use ViewBuilder to create base view for common code as follows:
struct BaseView<Content: View>: View {
let content: Content
init(@ViewBuilder content: () -> Content) {
self.content = content()
}
var body: some View {
// To-do: The most important part will go here
}
}
How we can add Navigation bar Code in View Builder or Base view?