本文主要是介绍CTMediator使用指南,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1. 安装CTMediator
- pod ‘CTMediator’
- https://github.com/casatwy/CTMediator
2. 注册CTMediator
- 创建Target对象
@interface Target_Object : NSObject@end
@implementation Target_Object@end
- 实现Action方法
- (id)Action_Method:(NSDictionary *)params {}
或
- (void)Action_Method:(NSDictionary *)params {}
3. 调用MGJRouter
[CTMediator.sharedInstance performTarget:targetName action:actionName params:params shouldCacheTarget:shouldCacheTarget];
4. 最后
CTMediator的运行原理,可从CTMediator解析中获取。
这篇关于CTMediator使用指南的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!