A state-driven navigation flow — Splash → Onboarding → Home — without NavigationStack.
CustomNavigationsSwiftUI demonstrates how to drive an app's top-level flow with a simple state machine instead of relying on NavigationStack or TabView. A single RootNavigations view owns an AppState enum (splash, onboarding, home) and swaps the visible screen with animated transitions as the state changes. The onboarding gate is persisted with @AppStorage, so returning users skip straight from the splash screen to the home screen.
- 🔀 Enum-based
AppState(splash/onboarding/home) that decides which screen is shown. - ⏱️ Timed splash screen that auto-advances after a short delay before routing the user.
- 💾 Persistent onboarding gate using
@AppStorage("isOnboardingDone")so it only runs once. - 🎬 Animated screen swaps driven by
withAnimationon state changes. - 🧩
onFinishcallback from onboarding cleanly hands control back to the root navigator. - 🍃 Pure SwiftUI, no external dependencies.
git clone https://github.com/ahmetbostanciklioglu/CustomNavigationsSwiftUI.git
cd CustomNavigationsSwiftUI
open CustomNavigationsSwiftUI.xcodeprojThen select a simulator and press Command-R to build and run.
- iOS 26.1+
- Xcode 16 or later
- Swift 5.0
Ahmet Bostancıklıoğlu — @ahmetbostanciklioglu · ahmetbostancikli@gmail.com
⭐ If this helped you, consider giving the repo a star!


