Latest 0.0.1
Homepage https://github.com/lhnoah/LHRouter
License MIT
Platforms ios 9.0
Authors

A smart iOS URL Router.

Installation

  • using CocoaPods

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the Get Started section for more details.

Podfile

pod 'LHRouter'

How To Use

#import <LHRouter/LHRouterCenter.h>

// Implement LHRouterCenterProtocol in a UIViewController

+ (NSString *)lh_routerURL // @optional
{
    return @"lh://router";
}

+ (BOOL)lh_showFromViewController:(UIViewController *)controller 
                     withUserInfo:(NSDictionary *)userInfo
{
    UIViewController *vc = [[self alloc] init];
    [controller presentViewController:vc animated:YES completion:nil];
    NSLog(@"%s %@", __func__, userInfo);
    return YES;
}

// Call the following method in an other UIViewController

[[LHRouterCenter sharedInstance] openURL:@"lh://router?title=&content=Hello World"
                      fromViewController:nil 
                            withUserInfo:nil];

Latest podspec

{
    "name": "LHRouter",
    "version": "0.0.1",
    "summary": "LHRouter.",
    "description": "A smart iOS URL Router",
    "homepage": "https://github.com/lhnoah/LHRouter",
    "license": "MIT",
    "authors": {
        "Noah": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lhnoah/LHRouter.git",
        "tag": "0.0.1"
    },
    "source_files": "LHRouter/Classes/**/*.{h,m}",
    "platforms": {
        "ios": "9.0"
    }
}

Pin It on Pinterest

Share This