I have a custom NavigationLink in SwiftUI. Now I'm trying to add isActive to my customNavLink but I'm facing with Missing argument for parameter 'isActive' in call across all project. I want to make this isActive optional to use where I need it.
Do you know how could I resolve this issue?
This is My CustomNavLink
struct CusNavLink<Label: View, Destination: View>: View {
let destination: Destination
let label : Label
let isActive: Binding<Bool>
init(destination: Destination, isActive: Binding<Bool>, @ViewBuilder label: () -> Label) {
self.destination = destination
self.label = label()
self.isActive = isActive
}
var body: some View {
NavigationLink(
destination: CusNavContainer{
destination
}
.navigationBarHidden(true),
isActive: isActive,
label:{
label
})
}
}