AsyncNavigationKit provides small, focused async wrappers around common UIKit navigation and presentation APIs. The goal is to make flow control in UIKit more predictable when transitions are animated.
- iOS 16+
- Swift 6.2+ (SwiftPM tools version 6.2)
Add the package to your SwiftPM dependencies:
// Package.swift
.package(url: "https://github.com/<your-org>/swift-AsyncNavigationKit", from: "0.1.0")Then add AsyncNavigationKit to the target dependencies that need it.
import AsyncNavigationKit
await presentAsync(DetailViewController(), animated: true)
await dismissAsync(animated: true)import AsyncNavigationKit
await navigationController.pushViewControllerAsync(
viewController: DetailViewController(),
animated: true
)
await navigationController.popViewControllerAsync(animated: true)import AsyncNavigationKit
await tabBarController.select(index: 2)
await tabBarController.select(SettingsViewController.self)
await tabBarController.popAsync(animated: true)
await tabBarController.pushAsync(DetailViewController(), animated: true)
await tabBarController.popAndPushAsync(DetailViewController(), animated: true)UITabBarControllerhelpers assumeviewControllersis set and that each tab is either aUINavigationControlleror a view controller of the target type.popAsync,pushAsync, andpopAndPushAsyncassume the selected tab is aUINavigationController.
API documentation is provided via DocC in
Sources/AsyncNavigationKit/Documentation.docc.
On macOS, you can generate the docs with:
swift package generate-documentationMIT