MGXRouter 1.0.0

MGXRouter 1.0.0

mangox 维护。



MGXRouter 1.0.0

  • By
  • mangox

MGXRouter

CI Status Version License Platform

描述

基本思路参考CTMediator。结合实际项目开发,在其基础上进行了功能完善。

目前支持的动态调用范围

1. 类方法
2. 对象方法
3. 单例

使用

参数传递说明

同时支持两种参数传递形式,若同时使用两种方式,则会进行参数合并。

  1. URL Query 方式用于传递 NSString 类型参数
  2. NSDictionary 支持非常规参数,如图片、自定义对象等

调用类方法

    //不带参数
    [MGXRouter openURL:@"Router://MGXTest/testClassMethod" params:nil];
    //带参数
    [MGXRouter openURL:@"Router://MGXTest/testClassMethod"

调用对象方法

	//不带参数
    [MGXRouter openURL:@"Router://MGXTest/testObjectMethod" params:nil];
    //带参数
    [MGXRouter openURL:@"Router://MGXTest/testObjectMethod?name=jobs&age=14" params:nil];

调用单例

    //带参数
    [MGXRouter openURL:@"Router://MGXTest/sharedInstance/testObjectMethod?age=13" params:@{}];
    //不带参数
    [MGXRouter openURL:@"Router://MGXTest/sharedInstance/testObjectMethod" params:nil];

更多信息请参阅Example工程。

示例

要运行示例项目,首先从Example目录运行pod install命令从Git仓库。

安装

MGXRouter可通过CocoaPods获取。要安装,只需将以下行添加到您的Podfile中

pod 'MGXRouter'

作者

mangox: www.devzhang.cn

许可协议

MGXRouter遵循MIT许可协议。详细信息请参阅LICENSE文件。