Giter Site home page Giter Site logo

liujianping / urltabnavigationcontroller Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 72 KB

SubClass of UITabBarController supports URLRouter & binding UINavigationController with UIView directly.

License: MIT License

Ruby 4.50% Objective-C 61.53% Shell 33.97%

urltabnavigationcontroller's Introduction

URLTabNavigationController

CI Status Version License Platform

Usage

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

Requirements

Installation

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

pod "URLTabNavigationController"

Quick Start

TabBar Navigation

#import "URLTabNavigationController.h"

//! singleton instance
URLTabNavigationController* tabNavigation = [URLTabNavigationController defaultTabNavigationController];

//! tab navigate url to class name
[tabNavigation navigate:@"/red" title:@"red" image:nil selectedImage:nil className:@"RedViewController"];
[tabNavigation navigate:@"/blue" title:@"blue" image:nil selectedImage:nil className:@"BlueViewController"];
[tabNavigation navigate:@"/yellow" title:@"yellow" image:nil selectedImage:nil className:@"YellowViewController"];

//! tab bar controller initialization
[tabNavigation initialization];

URL Router

#import "URLRouter.h"

//! singleton instance
URLRouter* router = [URLRouter defaultRouter];

//! router map path to class name
[router map:@"/home/:user" withControllerClassName: @"HomeViewController"];
[router map:@"/message" withControllerClassName: @"MessageViewController"];
[router map:@"/mine" withControllerClassName:@"MineViewController"];

//! router map path pattern example
[router map:@"/:name/:age/:hobby" withCompletion: ^(NSURL* url){
    NSLog(@"block exeucte (name: %@) (age: %@) (hobby: %@)", url.queryDictionary[@"name"], url.queryDictionary[@"age"], url.queryDictionary[@"hobby"]);
}];

//! router map path pattern for View Controller
UIViewController* vc = [router viewControllerForPath:@"/home/liujianping"];

//! router map path pattern for excute URL
[router executeURL:[[NSURL alloc] initWithString: @"/liujianping/36/movie"]];

Author

liujianping, [email protected]

License

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

urltabnavigationcontroller's People

Watchers

JayL avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.