TTBaseNavigationLink
NavigationA NavigationLink wrapper that auto-hides the destination's navigation bar by default, supports programmatic isActive binding, and optionally disables push animation NonAnimationButtonStyle.
🚀 Usage
// Standard tap-to-push link (bar auto-hidden)
TTBaseNavigationLink(destination: {
DetailView(item: item)
}, label: {
ItemRowView(item: item)
})
// With nav bar visible on destination
TTBaseNavigationLink(
destination: { AnotherView() },
label: { Text("Go to Another") },
isForceBarHidden: false
)
// Programmatic navigation (e.g. after login)
@State var showDashboard = false
TTBaseNavigationLink(
isActive: $showDashboard,
destination: { DashboardView() },
label: { EmptyView() }
)
// Trigger programmatically
Button("Login") {
viewModel.login { success in
if success { showDashboard = true }
}
}
// Without push animation
TTBaseNavigationLink(
destination: { SettingsView() },
label: { SettingsRow() },
isAnimation: false
)
📖 Parameters
| Parameter | Default | Description |
|---|---|---|
destination | Required | Destination view builder |
label | Required | Tappable trigger view |
isForceBarHidden | true | Hides nav bar on destination |
isAnimation | true | Enable/disable push slide animation |
isActive | nil | Optional Binding<Bool> for programmatic push |
Pro Tip: Use the
isActive binding variant for programmatic navigation triggered by business logic (network callbacks, form validation, login success). Prefer this over NavigationLink(destination:tag:selection:) which is deprecated in iOS 16+.