import SwiftUI
struct CustomNavView<Content: View>: View {
let content: Content
let title: String
init(title: String, @ViewBuilder content: () -> Content) {
self.content = content()
self.title = title
}
var body: some View {
NavigationLink(destination: self.content) {
Text(title)
}
.padding()
}
}
Usage:
CustomNavView(title: "Picker sample in SwiftUI") {
EmptyView()
}
Changelog:
// Good stuff. πββοΈ
git commit -m "Update to trailing closure as head_of_roses recommends"