A smart iOS URL Router.
- using 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.
pod 'LHRouter'
#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];