Latest 0.0.4
Homepage https://github.com/NEYouFan/ht-universalrouter-iOS
License MIT
Platforms ios 7.0
Dependencies HTR3, HTCommonUtility
Authors

UniversalRouter

UniversalRouter :使用URL来定位页面及页面导航。

特性

  • 去中心化的URL配置方式
  • 高性能的URL匹配算法,支持通配符和正则表达式
  • 支持跨应用或web view和native请求的响应,http链接升级成native页面
  • 支持单例、去循环等多种controller导航机制
  • 支持navigation的全屏返回手势,方便的接口设置自定义转场动画

用法

页面配置

配置页面,注册URL到Router

+ (HTControllerRouterConfig*)configureRouter
{
    HT_EXPORT();
    HTControllerRouterConfig *config = [[HTControllerRouterConfig alloc] initWithUrlPath:@"app://singleinstance/{id}"];
    return config;
}

简单的接口

在有导航栏的页面中push一个页面

#import "UIViewController+HTRouter.h"
[self pushViewControllerWithURL:@"app://aviewcontroller"];

详细的接口

用push方式打开一个单例页面,如果已经存在这个页面,将该页面从页面栈中取出,不影响其他页面栈中的页面

HTControllerRouteParam *param = [[HTControllerRouteParam alloc] initWithURL:@"app://singleinstance/12" launchMode:HTControllerLaunchModePush];
//支持配置单例页面的
param.singleInstanceShowMode = HTControllerInstanceShowModeMoveToTop;
[[HTControllerRouter sharedRouter] route:param];

安装

CocoaPods

  1. pod 'UniversalRouter' , :git=>'https://g.hz.netease.com/HTIOSUI/UniversalRouter.git'
  2. pod installpod update
  3. #import "UniversalRouter.h"

系统要求

该项目最低支持iOS 7.0Xcode 7.0

许可证

UniversalRouter,详情见LICENSE文件。

Latest podspec

{
    "name": "UniversalRouter",
    "version": "0.0.4",
    "summary": "u9875u9762u8df3u8f6cu7684router",
    "description": "u9875u9762u8df3u8f6cu7684routeruff0cu53efu4ee5u81eau5b9au4e49u6bcfu4e2au9875u9762u7684url",
    "homepage": "https://github.com/NEYouFan/ht-universalrouter-iOS",
    "license": "MIT",
    "authors": {
        "netease": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/NEYouFan/ht-universalrouter-iOS.git",
        "tag": "0.0.4"
    },
    "source_files": "HTControllerRouter/*.{h,m}",
    "public_header_files": "HTControllerRouter/*.h",
    "dependencies": {
        "HTR3": [
            "~> 0.0.1"
        ],
        "HTCommonUtility": [
            "~>0.0.2"
        ]
    },
    "subspecs": [
        {
            "name": "Controller",
            "source_files": [
                "HTControllerRouter/**/*.{h,m}",
                "HTControllerRouter/HTControllerRouteInfo.h",
                "HTControllerRouter/HTControllerRouter.h"
            ],
            "public_header_files": "HTControllerRouter/Controller/*.h"
        }
    ]
}

Pin It on Pinterest

Share This