Navigation is a SwiftUI framework that simplifies and enhances navigation in your applications. It centralizes state management through the Navigator
class, making it easier to handle navigation actions, sheets, alerts, and confirmation dialogs.
- iOS: 16.0+
- macOS: 13.0+
- tvOS: 16.0+
- watchOS: 9.0+
- Swift: 6.0+
- Xcode: 16.0+
Navigation offers powerful tools for managing navigation state:
- Centralized State Management: Use the
Navigator
class to manage navigation actions, alerts, sheets, and confirmation dialogs. - Automatic Navigator Injection: The
Navigation
view automatically creates and injects aNavigator
into the environment. - Environment Access: Access the
Navigator
throughout your app via@EnvironmentObject
. - Seamless SwiftUI Integration: Works smoothly with SwiftUI's
NavigationStack
,NavigationLink
, andnavigationDestination
. - Simplified UI Components: Manage sheets, alerts, and confirmation dialogs without multiple
@State
variables. - Type-Safe Navigation: Ensure type safety by using custom
Hashable
data types for navigation. - Programmatic Navigation: Support dynamic navigation flows by pushing and popping views based on conditions or events.
To add Navigation to your SwiftUI project, follow the detailed instructions in the Installation Guide.
After installation, refer to the Usage Overview for a quick introduction on setting up and using the framework.
Explore Navigation's documentation to get the most out of the framework:
- Installation Guide: Steps to add Navigation to your project using Swift Package Manager.
- Usage Overview: A quick start guide with key features and example implementations.
- Navigation Techniques: Discover various navigation methods using the
Navigator
, including pushing and popping views,NavigationLink
, andNavigatorButton
. - Modals, Alerts, and Dialogs: Learn how to present sheets, alerts, and confirmation dialogs using the
Navigator
. - Advanced Usage: Delve into advanced topics like custom navigation actions, deep linking, and environment integration.
- Patterns and Best Practices: Improve your app's navigation architecture by following best practices.
- API Overview: A comprehensive overview of the
Navigator
API.
With Navigation installed, start exploring its features by reading the Usage Overview and the detailed guides. Begin managing navigation effectively in your SwiftUI projects. For advanced techniques, consult the Advanced Usage Guide.
This project is licensed under the MIT License. See the LICENSE file for details.