美文网首页iOS技术点
iOS 跳转 路由表

iOS 跳转 路由表

作者: MenaceiOS | 来源:发表于2020-09-23 10:56 被阅读0次

WMRoute

一个高效,灵活,简单的iOS替换路由

为什么要在造一个轮子?

已经有很多款不错的Route了,但都不是很满足需求。有的不够高效,有的需要进行注册。很繁琐,于是就有了WMRoute。

安装

下载Demo,把WMRoute文件拷贝到工程即可
Demo地址:GitHub

使用教程

声明Controller比注册简单,就一句话,而且在主工程看不见代码

//代码创建 viewController
#define URL_TestAViewController @"code://TestAViewController"

//storyboard 创建 viewController
#define URL_TestBViewController          @"sb://Main/TestBViewController"

在需要跳转处实现

[[WMRoute route]pushWithURLString:URL_TestAViewController param:nil animated:YES];

[[WMRoute route]presentWithURLString:URL_TestBViewController param:@{@"textId":@"33333"} animated:YES completion:nil];

传参直接在 param 中携带 即可。

相关文章

网友评论

    本文标题:iOS 跳转 路由表

    本文链接:https://www.haomeiwen.com/subject/jdinyktx.html