iOS解耦路由映射方式
# HXRouter
路由库,可设置映射。
# 引入
pod 'HXRouters'
# 兼容 iOS8+
#使用
```
1、
//配置 在pch预编译文件中,方便全局调用
#import "HXRouterUtil.h"
2、
//注册 协议与类的绑定
@HXRouterRegister(TestServiceProtocol, TestService) //协议实现对应,写入配置中【不能放.h】
@interface TestService()
@end
@implementation TestService
3、
+ (void)load {
/*
路由映射
如: 路由字符 实际调用
/dddd/enter 对应 /DDProtocol/test:aa:bb##param1¶m2
*/
[[HXAnnotationMananger shareManager] addRouterMappingWithRouterStr:@"/test/goVCWithTitle" mapping:@"TestServiceProtocol/getVCWithTitle:other:##title&other"];
[[HXAnnotationMananger shareManager] addRouterMappingWithRouterStr:@"/test/goVC" mapping:@"TestServiceProto