All Projects → corteggo → NavigationRouter

corteggo / NavigationRouter

Licence: MIT license
A router implementation designed for complex modular apps, written in Swift

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to NavigationRouter

Swiftuirouter
Routing in SwiftUI
Stars: ✭ 242 (+171.91%)
Mutual labels:  navigation, path
Builder
Demonstrates SwiftUI builder patterns for UIKit and networking.
Stars: ✭ 100 (+12.36%)
Mutual labels:  uikit, swiftui
Dropdownmenukit
UIKit drop down menu, simple yet flexible and written in Swift
Stars: ✭ 246 (+176.4%)
Mutual labels:  navigation, uikit
Helm
A graph-based SwiftUI router
Stars: ✭ 64 (-28.09%)
Mutual labels:  navigation, swiftui
SwiftCurrent
A library for managing complex workflows in Swift
Stars: ✭ 286 (+221.35%)
Mutual labels:  uikit, swiftui
Tlyshynavbar
Unlike all those arrogant UINavigationBar, this one is shy and humble! Easily create auto-scrolling navigation bars!
Stars: ✭ 3,780 (+4147.19%)
Mutual labels:  navigation, uikit
RouterService
💉Type-safe Navigation/Dependency Injection Framework for Swift
Stars: ✭ 212 (+138.2%)
Mutual labels:  modular, navigation
About Swiftui
Gathering all info published, both by Apple and by others, about new framework SwiftUI.
Stars: ✭ 5,954 (+6589.89%)
Mutual labels:  uikit, swiftui
SwiftUI-bez
Utilities for working with bezier curves in SwiftUI
Stars: ✭ 80 (-10.11%)
Mutual labels:  path, swiftui
Navigator
Android Multi-module navigator, trying to find a way to navigate into a modularized android project
Stars: ✭ 131 (+47.19%)
Mutual labels:  modular, navigation
SettingsAppInSwiftUI
I have recreated a Settings App in iPhoneXR using SwiftUI concepts such as Form,Section,Toggle,Picker,Stack..etc
Stars: ✭ 37 (-58.43%)
Mutual labels:  navigation, swiftui
swiftui-example
SwiftUI 示例,技巧和技术集合,帮助我构建应用程序,解决问题以及了解SwiftUI的实际工作方式。
Stars: ✭ 109 (+22.47%)
Mutual labels:  uikit, swiftui
tca-swiftui-navigation-demo
Demo project that shows how to implement navigation in SwiftUI iOS application using Swift Composable Architecture
Stars: ✭ 75 (-15.73%)
Mutual labels:  navigation, swiftui
Appearancenavigationcontroller
Example with advanced configuration of the navigation controller's appearance
Stars: ✭ 91 (+2.25%)
Mutual labels:  navigation, uikit
Render
UIKit a-là SwiftUI.framework [min deployment target iOS10]
Stars: ✭ 2,150 (+2315.73%)
Mutual labels:  uikit, swiftui
universal-router
↩️ Router for every occasions
Stars: ✭ 64 (-28.09%)
Mutual labels:  modular, navigation
Swiftui Cheat Sheet
SwiftUI 2.0 Cheat Sheet
Stars: ✭ 3,417 (+3739.33%)
Mutual labels:  uikit, swiftui
Swift Composable Architecture
A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
Stars: ✭ 5,199 (+5741.57%)
Mutual labels:  uikit, swiftui
Tabler
Tabler is free and open-source HTML Dashboard UI Kit built on Bootstrap
Stars: ✭ 24,611 (+27552.81%)
Mutual labels:  modular, uikit
Router
Router is a library that assists with SwiftUI view transitions.
Stars: ✭ 68 (-23.6%)
Mutual labels:  navigation, swiftui

NavigationRouter

NavigationRouter is a router implementation designed for complex modular apps, written in Swift.

Features 🌟

  • Decoupled routing registration.
  • Decoupled navigation between views and modules.
  • Custom navigations with parameters.
  • Navigation interceptions to make things easier (onboardings, tutorials...).
  • Lightweight codebase.
  • Works with iOS, iPadOS and macOS Catalyst.
  • Works with both UIKit and SwiftUI.
  • Supports external navigation handling.
  • Supports multiple UIScene instances.
  • Supports any kind of authentication for routing permissions. Including OAuth authentication callbacks.

Please note SwiftUI support requires iOS 13.0 or newer and macOS 10.15 or newer.

Supported platforms 📱

  • iOS 11.0+.
  • macOS 10.15+.
  • Xcode 11.0+.
  • Swift 5.0+.

watchOS and tvOS support will eventually be added in future releases.

How does it work

Writing simple apps is easy but writing large ones can be very complex. At that point modular architectures usually come to the rescue, but it's hard to navigate between views and modules without coupling them, ending in a very complex dependency graph that's hard to maintain and developers leave your company because the project becomes no longer attractive.

This library tries to fix that problem, so your developers are still happy after many years of app development. It has been designed to navigate between different views and modules without actually knowing the destination object, making things easier.

I recommend you to read my article about Building complex modular architectures with SwiftUI, Combine and Swift Package Manager (SPM) to understand how this router works internally.

Installation ⚙️

Swift Package Manager

Swift Package Manager is a tool for automating the distribution of Swift code and it is integrated in Xcode. Once you have your project ready, adding NavigationRouter as a dependency is as easy as adding it to the dependencies value of your Package.swift manifest file or to the "Swift packages" tab in Xcode.

dependencies: [
    .package(url: "https://github.com/corteggo/NavigationRouter.git", .branch("main"))
]

You can choose between always using the latest version (main branch) or using a specific version.

CocoaPods

CocoaPods is a centralized dependency manager for iOS projects. For usage and installation instructions, please visit their website. To integrate NavigationRouter into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'NavigationRouter', :git => 'https://github.com/corteggo/NavigationRouter.git', :branch => 'main'

I've decided not to make this project available in central repository. Please consider dropping CocoaPods usage as it will no longer be supported by this library in the future, given that Swift Package Manager now supports binaries and resources as of Xcode 12. There's no need to use CocoaPods anymore.

How to use it

Check out DOCUMENTATION.md for details.

Sample project

Please download the project and run "NavigationRouterTestApp" for a working example. It supports iOS, iPadOS and macOS Catalyst and shows all available scenarios described here.

Known issues ‼️

Navigating between SwiftUI views

Please note when using two SwiftUI views hosted with UIHostingController a weird animation happens when you're navigating between views using different UINavigationBar display modes. As a workaround, when using SwiftUI for your app, always choose between "large" or "inline" display modes but do not mix them in the same navigation route. You can also leave it at .automatic to avoid this problem. This has already been reported to Apple via Feedback Assistant as FB7648851.

Miscelanea 🚏

  • Changelog: check out CHANGELOG.md for details.
  • Credits: NavigationRouter is owned and maintained by corteggo.
  • License: NavigationRouter is released under the MIT license. See LICENSE for details.
  • Want to contribute? Suggest your idea as a feature request for this project or create a bug report.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].