Git Product home page Git Product logo

mdrouter's Introduction

MDRouter

Introduction

  • The router for transitioning or logical processing.
  • Return output for handling result and return error for exceptions.
  • Support verification for preprocessing, processing continued if return nil, or transmited the returned solution.
- (id<MDRouterSolution>)verifyValidWithRouterArguments:(NSDictionary *)arguments;
  • Support verification for optional arguments, processing interrupted if non-matched arguments.
@property (nonatomic, strong, readonly) NSDictionary<NSString *, NSNumber *> *argumentConditions;
  • Support pure URL defination for cross-module or cross-platform.
- (BOOL)openURL:(NSURL *)URL output:(id *)output error:(NSError **)error;
  • Support URL with extensional arguments for native routing.
- (BOOL)openURL:(NSURL *)URL arguments:(NSDictionary *)arguments output:(id *)output error:(NSError **)error;
  • Support adapter mode, provide protocol and base class MDRouterAdapter to extend, easy to divide into groups for different kind of routing.

  • Provide solution protocol defination for any instance or class, also asynchronous solution, see MDRouterSolution, MDRouterClassSolution, MDRouterAsynchronizeSolution, MDRouterAsynchronizeClassSolution

  • Provide default simple adapter and solution, handle logic with block or target-action, see MDRouterSimpleAdapter, MDRouterSimpleSolution, MDRouterAsynchronizeSampleSolution

  • Default adapter MDRouterWebsiteAdapter, to match URL which contained http / https scheme.

  • Default adapter MDRouterUndirectionalAdapter is the ultimate solution, to match the URL that never matched.

  • Provide default implementation for UIViewController transitioning, see UIViewController+MDRouterSolution

How To Get Started

  • Download MDRouter and try run example app

Installation

  • Installation with CocoaPods
source 'https://github.com/Modool/cocoapods-specs.git'
platform :ios, '8.0'

target 'TargetName' do
pod 'MDRouter', '~> 1.0.0'
end

  • Installation with Carthage
github "Modool/MDRouter" ~> 1.0.0
  • Manual Import
drag “MDRouter” directory into your project

Requirements

  • Requires ARC

Architecture

Router

  • MDRouterSet

Adapter

  • MDRouterAdapter
  • MDRouterSimpleAdapter
  • MDRouterUndirectionalAdapter
  • MDRouterWebsiteAdapter

Solution Protocol

  • MDRouterSolution
  • MDRouterClassSolution
  • MDRouterAsynchronizeSolution

Solution Class

  • MDRouterSampleSolution
  • MDRouterAsynchronizeSampleSolution
  • UIViewController+MDRouterSolution

Private

  • MDRouterSolutionItem
  • MDRouterSolutionContainer

Usage

  • Demo FYI

Update History

  • 2017.12.27 Add README and adjust project class name.

License

MDRouter is released under the MIT license. See LICENSE for details.

Communication

mdrouter's People

Contributors

levenon avatar

Watchers

James Cloos avatar 李新新 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.