All Projects → freshOS → Router-deprecated

freshOS / Router-deprecated

Licence: MIT license
🛣 Simple Navigation for iOS - ⚠️ Deprecated

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Router-deprecated

Router
🛣 Simple Navigation for iOS
Stars: ✭ 438 (-4.37%)
Mutual labels:  navigation, routing, viewcontroller, microframework
routing-py
🌎 Python library to access all public routing, isochrones and matrix APIs in a consistent manner.
Stars: ✭ 106 (-76.86%)
Mutual labels:  navigation, routing
fastglue
Fastglue is an opinionated, bare bones wrapper that glues together fasthttp and fasthttprouter to act as a micro HTTP framework.
Stars: ✭ 71 (-84.5%)
Mutual labels:  routing, microframework
Nested Navigation Demo Flutter
Nested navigation with BottomNavigationBar
Stars: ✭ 367 (-19.87%)
Mutual labels:  navigation, routing
Grip
The microframework for writing powerful web applications.
Stars: ✭ 137 (-70.09%)
Mutual labels:  routing, microframework
demo-ionic-tab-routing
An Ionic project which shows different kinds of route definition for a tab based layout.
Stars: ✭ 34 (-92.58%)
Mutual labels:  navigation, routing
ASMapLauncher
ASMapLauncher is a library for iOS written in Swift that helps navigation with various mapping applications.
Stars: ✭ 41 (-91.05%)
Mutual labels:  navigation, routing
organicmaps
🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Your donations and positive reviews motivate and inspire our small team!
Stars: ✭ 3,689 (+705.46%)
Mutual labels:  navigation, routing
Findme
An ARKit App that can help your friends to find you
Stars: ✭ 483 (+5.46%)
Mutual labels:  navigation, routing
Corenavigation
📱📲 Navigate between view controllers with ease. 💫 🔜 More stable version (written in Swift 5) coming soon.
Stars: ✭ 69 (-84.93%)
Mutual labels:  navigation, routing
Mapbox Directions Swift
Traffic-aware directions and map matching in Swift on iOS, macOS, tvOS, watchOS, and Linux
Stars: ✭ 115 (-74.89%)
Mutual labels:  navigation, routing
go router
The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
Stars: ✭ 380 (-17.03%)
Mutual labels:  navigation, routing
Swiftuirouter
Routing in SwiftUI
Stars: ✭ 242 (-47.16%)
Mutual labels:  navigation, routing
Url Parser
Parse URLs into nicely structured data
Stars: ✭ 118 (-74.24%)
Mutual labels:  navigation, routing
easyRNRoute
https://medium.com/@kevinle/comprehensive-routing-and-navigation-in-react-native-made-easy-6383e6cdc293#.nttfeeq3p
Stars: ✭ 25 (-94.54%)
Mutual labels:  navigation, routing
shortcuts-for-chrome
Chrome navigation menu for technical users.
Stars: ✭ 28 (-93.89%)
Mutual labels:  navigation
shortcut
Quickly make and use shortcuts in your shell for easy navigation
Stars: ✭ 17 (-96.29%)
Mutual labels:  navigation
trellio
Python3 asyncio based microframework for microservice architecture
Stars: ✭ 19 (-95.85%)
Mutual labels:  microframework
active admin-subnav
Enhanced sub-navigation for nested ActiveAdmin resources
Stars: ✭ 20 (-95.63%)
Mutual labels:  navigation
BBB-routing
🅱🅱🅱-routing - a simulation of Network layer protocols with Byzantine Robustness
Stars: ✭ 15 (-96.72%)
Mutual labels:  routing

Router

⚠️ Deprecated and no longer supported. Use at your own risks.
This has been used extensively and after weighing up pros and cons, we now favour the use of native Flow Controllers or Coordinators as explained here.
The native route (pun intended) should always be favoured and we believe less dependencies is something we should always strive for.

Router

Language: Swift Platform: iOS 8+ Carthage compatible Build Status License: MIT Release version

Reason - Get Started - Installation

Router

Why

Because classic App Navigation introduces tight coupling between ViewControllers. Complex Apps navigation can look like a gigantic spider web.

Besides the fact that Navigation responsibility is split among ViewControllers, modifying a ViewController can cascade recompiles and produce slow compile times.

How

By using a Navigation enum to navigate we decouple ViewControllers between them. Aka they don't know each other anymore. So modifying VCA won't trigger VCB to recompile anymore \o/

// navigationController?.pushViewController(AboutViewController(), animated: true)
navigate(.about)

Navigation code is now encapsulated in a AppNavigation object.

Benefits

  • Decouples ViewControllers
  • Makes navigation Testable
  • Faster compile times

Get started

1 - Declare your Navigation enum

enum MyNavigation: Navigation {
    case about
    case profile(Person)
}

Swift enum can take params! Awesome for us because that's how we will pass data between ViewControllers :)

2 - Declare your App Navigation

struct MyAppNavigation: AppNavigation {

    func viewcontrollerForNavigation(navigation: Navigation) -> UIViewController {
        if let navigation = navigation as? MyNavigation {
            switch navigation {
            case .about:
                return AboutViewController()
            case .profile(let p):
                return ProfileViewController(person: p)
            }
        }
        return UIViewController()
    }

    func navigate(_ navigation: Navigation, from: UIViewController, to: UIViewController) {
      from.navigationController?.pushViewController(to, animated: true)
    }
}

A cool thing is that the swift compiler will produce an error if a navigation case is not handled ! Which would'nt be the case with string URLs by the way ;)

3 - Register your navigation on App Launch

In AppDelegate.swift, before everything :

Router.default.setupAppNavigation(appNavigation: MyAppNavigation())

4 - Replace navigations in your View Controllers

You can now call nagivations from you view controllers :

navigate(MyNavigation.about)

Bridge Navigation with your own enum type, here MyNavigation so that we don't have to type our own.

extension UIViewController {

    func navigate(_ navigation: MyNavigation) {
        navigate(navigation as Navigation)
    }
}

You can now write :

navigate(.about)

Bonus - Tracking

Another cool thing about decoupling navigation is that you can now extract traking code from view Controllers as well. You can be notified by the router whenever a navigation happened.

Router.default.didNavigate { navigation in
    // Plug Analytics for instance
    GoogleAnalitcs.trackPage(navigation)
}

Shave off compilation times

There is a nasty bug in Swift 3 compiler where the compiler rebuilds files even though they haven't changed. This is documented here : https://forums.developer.apple.com/thread/62737?tstart=0

Due to this bug, the compilation can go like this :

Change ViewController1 -> Build
-> Compiles ViewController1, referenced in MyAppNavigation so
MyAppNavigation gets recompiled. MyAppNavigation is referenced in AppDelegate which gets recompiled which references ... App -> ViewController2 -> ViewController3 -> ViewControllerX you get the point. Before you know it the entire App gets rebuilt :/

A good this is that most of the app coupling usually comes from navigation. which Router decouples.

We can stop this nonsense until this gets fixed in a future release of Xcode. Router can help us manage this issue by injecting our AppNavigation implementation at runtime.

In your AppDelegate.swift

// Inject  your AppNavigation  at runtime to avoid recompilation of AppDelegate :)
Router.default.setupAppNavigation(appNavigation: appNavigationFromString("YourAppName.MyAppNavigation"))

And make sure your AppNavigation implementation is now a class that is RuntimeInjectable

class MyAppNavigation: RuntimeInjectable, AppNavigation {

Installation

Carthage

github "freshOS/Router"

Manually

Simply Copy and Paste Router.swift files in your Xcode Project :)

As A Framework

Grab this repository and build the Framework target on the example project. Then Link against this framework.

Backers

Like the project? Offer coffee or support us with a monthly donation and help us continue our activities :)

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site :)

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].