A Swift-based URL router for iOS that maps URLs to view controllers and handlers with automatic parameter parsing.
SwiftRouter is a URL routing library for iOS apps built with Swift. It allows developers to map URLs to specific view controllers or handler functions, enabling seamless navigation and parameter passing between screens. It solves the problem of managing complex navigation flows and deep linking by providing a declarative routing system.
iOS developers building Swift-based applications who need a structured way to handle navigation, deep linking, or URL-driven interface flows.
Developers choose SwiftRouter for its Swift-native design, automatic parameter injection, and support for both storyboard and code-based view controllers, offering a lightweight alternative to larger routing frameworks.
A URL Router for iOS, written in Swift
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Parses URL path and query parameters directly into view controller properties, as shown in the UserViewController example, reducing boilerplate code for navigation.
Supports loading view controllers from storyboards by matching identifiers, allowing seamless use with existing UI workflows without rewriting code.
Maps URLs to custom closures for executing logic without view controllers, enabling non-UI routing tasks like API calls or data processing.
Leverages Swift's features for a clean API, as indicated in the philosophy, and is easy to integrate with Carthage and CocoaPods for dependency management.
Requires `@objc` annotations on properties for parameter injection, which can be a limitation in pure Swift code and adds complexity, as noted in the version compatibility table.
The README highlights version-specific breaking changes, such as in 2.1.0 and 3.0.0, which could disrupt upgrade paths and require code adjustments.
Lacks built-in support for common routing needs like authentication guards, error handling, or asynchronous operations, forcing developers to implement these manually.