FZRoutable 0.0.1

FZRoutable 0.0.1

Maintained by wufuzeng.



  • By
  • wufuzeng

你刚好需要,我刚好出现,请赏一颗小星星.

FZRoutable

特征

  • 1. 本地路由路径参照Web URL格式设计。
  • 2. 支持本地和web路由。
  • 3. 支持路由界面唯一性。
  • 4. 支持顶层界面刷新。

CI Status Version License Platform

要运行示例项目,请克隆repo,然后从Example目录运行 ”pod install“。

要求

RouterProfile.plist 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>path</key><string>[path映射的VC界面类名]</string>
</dict>
</plist>

安装

FZRoutable 可通过CocoaPods获得. 要安装它,只需将以下行添加到Podfile文件

pod 'FZRoutable'

怎样使用

  • Objective-C
    1. info.plist -> URL Types ->URL Schemes ->"local / [自定义]".
    1. 新建全局路由配置文件“RouterProfile.plist”.
    1. 配置路由单例。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{

[code]...

[FZRoutable globalRouter].localScheme = @"local";
[FZRoutable globalRouter].unique = true;
[FZRoutable registerRoutesWithProfile:@"RouterProfile"];

[code]...

}

-(void)skipAction:(UIButton *)sender{

/**
* 路由路径规则定义
* local://host:port/path?Query=&params=
* local://Domin/VCIdentification?q=funcName&param1=value1&param2=value2&param1=value3
*/

[FZRoutable open:@"local://path?key1=value1&key2=value2"];
}


//Objective-C代码
  • Swift
//swif代码

路由处理逻辑

作者

wufuzeng, [email protected]

纵有疾风起,人生不言弃

许可证

FZRoutable is available under the MIT license. See the LICENSE file for more info.