Latest 0.0.3
Homepage https://github.com/snice/ORouter
License MIT
Platforms ios 8.0
Authors

fork SDRouter + oc-runtime

看到SDRouter后,发现原理很简单,然而和其他router框架一样都需要主动添加各种block,因此为了解放block,ORouter 诞生了。

特性

  • 自动装载路由block
  • 采用define添加路由
  • 支持加载storyboard中的viewcontroller

使用

  1. 安装

    pod 'ORouter'
  2. 创建TestViewController

    TestViewController.h

    #import <UIKit/UIKit.h>
    #import <ORouter/ORouter.h>
    @interface TestViewController : ORouterViewController
    @end

    TestViewController.m

    #import "TestViewController.h"
    
    #define SCHEMA_EASY @"easy"
    #define HOST_EASY @"router.flyma.top"
    
    #define ROUTE_PATH_SECOND [email protected]"/second/test"
    
    @interface TestViewController ()
    
    @end
    
    @implementation TestViewController
    
    ROUTER_PATH(SCHEMA_EASY, ROUTE_PATH_SECOND)
    ROUTER_STORYBOARD(Main, TestViewController)
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        self.title = @"Second";
        NSLog(@"%@", self.params);
    }
    
    @end
  3. 进入路由

    [[ORouter shareRutor] openRoute:[NSURL URLWithString:@"easy://router.flyma.top/second/test?test=23"]];

    采用标准URL规范,queryString 会自动绑定ORouterViewController的params

License

Copyright 2018 zhe Zhu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Latest podspec

{
    "name": "ORouter",
    "version": "0.0.3",
    "summary": "oc runtime router",
    "description": "oc runtime Router",
    "homepage": "https://github.com/snice/ORouter",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "zhuzhe": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/snice/ORouter.git",
        "tag": "0.0.3"
    },
    "source_files": [
        "Classes",
        "Classes/**/*.{h,m}"
    ],
    "exclude_files": "Classes/Exclude",
    "public_header_files": "Classes/**/*.h"
}

Pin It on Pinterest

Share This