TTBaseNavigationLink

Navigation

A 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

ParameterDefaultDescription
destinationRequiredDestination view builder
labelRequiredTappable trigger view
isForceBarHiddentrueHides nav bar on destination
isAnimationtrueEnable/disable push slide animation
isActivenilOptional 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+.