- 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, seeUIViewController+MDRouterSolution
- Download
MDRouter
and try run example app
- 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
- Requires ARC
MDRouterSet
MDRouterAdapter
MDRouterSimpleAdapter
MDRouterUndirectionalAdapter
MDRouterWebsiteAdapter
MDRouterSolution
MDRouterClassSolution
MDRouterAsynchronizeSolution
MDRouterSampleSolution
MDRouterAsynchronizeSampleSolution
UIViewController+MDRouterSolution
MDRouterSolutionItem
MDRouterSolutionContainer
- Demo FYI
- 2017.12.27 Add README and adjust project class name.
MDRouter
is released under the MIT license. See LICENSE for details.