A complete iOS demo app that showcases every feature of RouteKit.
- WindowCoordinator -- root view controller switching with cross-dissolve animation
- TabBarCoordinator -- tab management with 3 tabs (Home, Explore, Profile)
- NavigationCoordinator -- push, pop, pop-to-root, and modal presentation
- Router in ViewModels -- MVVM pattern with clean ViewModel/Coordinator separation
- Modal presentation + dismiss detection --
didDismissModalViewControllerfor swipe-to-dismiss - Pop detection --
didPopViewControllerfor back-button/swipe-back cleanup - SwiftUI views via hostingController -- SwiftUI + UIKit interop
- Custom transition animations --
TransitionAnimationwith customUIViewControllerAnimatedTransitioning - Deep linking -- chained routes across coordinators (switch tab + push detail)
- Transition.multiple -- composing multiple transitions
- Transition.route -- re-routing from one route to another
- Child coordinator lifecycle -- addChild / removeChild
- Install XcodeGen if you don't have it:
brew install xcodegen - From this
Example/directory, run:xcodegen generate - Open
RouteKitExample.xcodeprojin Xcode - Select an iOS 18+ simulator and build & run
The project.yml is the source of truth — the .xcodeproj is gitignored and regenerated.
- Open Xcode and create a new iOS App project (Interface: Storyboard, Language: Swift).
- Delete the auto-generated
ViewController.swift,Main.storyboard, and any SceneDelegate/AppDelegate files. - In the project's Info.plist, remove the "Main storyboard file base name" key.
- Copy all
.swiftfiles from thisExample/directory (including subdirectories) into your Xcode project. - In Xcode, go to the project settings > Package Dependencies > click + > Add Local... > select the
RouteKit/root directory (the parent of thisExample/folder). - In your app target's Frameworks, Libraries, and Embedded Content, add
RouteKit. - Set the deployment target to iOS 18.0 or later.
- Build and run.
Note: Do not import both
SwiftUIandRouteKitin the same file —SwiftUI.Transitionconflicts withRouteKit.Transition. Keep SwiftUI views in separate files.
Launch
-> LoginViewController (via AppCoordinator / WindowCoordinator)
-> Tap "Login"
-> MainTabCoordinator (TabBarCoordinator) with 3 tabs:
[Home] [Explore] [Profile]
HomeCoordinator ExploreCoordinator ProfileCoordinator
NavigationCoordinator NavigationCoordinator NavigationCoordinator
| | |
HomeListViewController ExploreViewController (root VC)
(uses HomeViewModel) | |
| ExploreDetailVC ProfileDetailView
DetailViewController (custom slide-from- (SwiftUI via
(pushed) bottom animation) hostingController)
|
SettingsViewController
(presented modally)
Deep Link button on Home -> switches to Explore tab + pushes detail
| File | Demonstrates |
|---|---|
AppDelegate.swift |
Minimal app delegate, window setup |
SceneDelegate.swift |
Creates AppCoordinator (WindowCoordinator) |
Coordinators/AppCoordinator.swift |
WindowCoordinator, setRoot, switchTo |
Coordinators/MainTabCoordinator.swift |
TabBarCoordinator, setTabCoordinators, configureTabs, selectTab |
Coordinators/HomeCoordinator.swift |
NavigationCoordinator, push/pop/present, didPopViewController, didDismissModalViewController |
Coordinators/ExploreCoordinator.swift |
NavigationCoordinator, custom TransitionAnimation |
Coordinators/ProfileCoordinator.swift |
NavigationCoordinator, hostingController for SwiftUI |
ViewModels/HomeViewModel.swift |
Router in ViewModel (MVVM pattern) |
ViewControllers/LoginViewController.swift |
Simple login UI |
ViewControllers/HomeListViewController.swift |
Table view driven by HomeViewModel |
ViewControllers/DetailViewController.swift |
Pushed detail screen |
ViewControllers/SettingsViewController.swift |
Modally presented settings |
ViewControllers/ExploreViewController.swift |
Explore items list |
ViewControllers/ExploreDetailViewController.swift |
Custom animation target |
SwiftUIViews/ProfileDetailView.swift |
SwiftUI view hosted in UIKit |
Animations/SlideFromBottomAnimator.swift |
Custom UIViewControllerAnimatedTransitioning |