Latest 0.1.1
Homepage https://github.com/wsv587/WSRouter
License MIT
Platforms ios 8.0
Dependencies WSBox
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Cocoapods

WSRouter is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'WSRouter'

Source code

WSRouter/Classes文件夹下的所有.h、.m文件拖入工程中。

Usage

1.引入主头文件#import <WSRouter/WSRouter.h>#import WSRouter.h

2.在+(void)load方法中使用WSRouter的registerRouterWithPrefixURL系列方法注册URL

3.使用transferFromViewController系列方法实现控制器跳转

Example

1.注册


+ (void)load {
    NSURL *url = [NSURL URLWithString:@"WS://www.ws.com/first"];
    [WSRouter registerRouterWithPrefixURL:url handler:^UIViewController *(NSURL *URL, UIViewController *sourceViewController) {
        UIViewController *destViewController = [[WSPushedViewController alloc] init];
        [WSRouter transferViewController:destViewController
                      fromViewController:sourceViewController
                              transition:WSTransitionPush];
        return destViewController;
    }];
}

2.跳转

[WSRouter transferFromViewController:self toURL:[NSURL URLWithString:@"WS://www.ws.com/first?uid=666"]];

Author

ws, [email protected]

License

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

Latest podspec

{
    "name": "WSRouter",
    "version": "0.1.1",
    "summary": "An url-based and light-weight router for iOS app.",
    "description": "An url-based and light-weight router for iOS app...",
    "homepage": "https://github.com/wsv587/WSRouter",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ws": "[email protected]"
    },
    "source": {
        "git": "https://github.com/wsv587/WSRouter.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "WSRouter/Classes/**/*",
    "dependencies": {
        "WSBox": [
            "0.4.8"
        ]
    }
}

Pin It on Pinterest

Share This