CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2017 |
Maintained by hujiaju.
pod 'PBMediator'
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
//for safe check to setup scheme
[PBMediator setupForScheme:@"balabala"];
...
return YES;
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options {
//balabala://NHWebBrowser/initWithUrlParams:?url=http://baidu.com
NSLog(@"url:%@---opt:%@",url,options);
if ([url.scheme isEqualToString:@"balabala"]) {
UIViewController *ctr = [[PBMediator shared] remoteCallWithURL:url];
[self.rootNaviCtr pushViewController:ctr animated:true];
return true;
}
return false;
}
1-初始化字典传值方式
- (void)callNativeWebBrowserByURL {
NSString *url = @"balabala://NHWebBrowser/initWithUrlParams:?url=http://baidu.com";
UIViewController *ctr = [[PBMediator shared] nativeCallWithURL:[NSURL URLWithString:url]];
[self.navigationController pushViewController:ctr animated:true];
}
2-分类实现方式
- (void)callNativeWebBrowserByCategory {
UIViewController *ctr = [[PBMediator shared] wb_calledByTitle:@"baidu" withUrl:@"http://github.com/iFindTA/"];
[self.navigationController pushViewController:ctr animated:true];
}