陈斌彬的技术博客

Stay foolish,stay hungry

RxWebViewController

it’s a custom UIWebViewController that navigate like navigationController,just like wechat do.

实现类似微信的webView导航效果,左滑返回上个网页,就像UINavigationController

Install 安装


You just need to drag/copy the “RxWebViewController” folder and drop in your project 将“RxWebViewController”文件夹拖进你的工程中即可

init and push


usage is simple

    NSString* urlStr = @"http://github.com";
    RxWebViewController* webViewController = [[RxWebViewController alloc] initWithUrl:[NSURL URLWithString:urlStr]];
    [self.navigationController pushViewController:webViewController animated:YES];

and if you want to do some custom things with webview,just subclass it 如果你需要webview的更进一步自定义,子类化即可

    @interface myWebViewController : RxWebViewController

    //do your custom things

    @end

navigation bar tint color and back button style 导航栏的颜色和返回按钮样式

导航栏中出现的 返回 和 关闭 ,均会继承你的 navigationController 中对 navigationBar 的设置,比如:

    UIColor* tintColor = [UIColor whiteColor];
    UIColor* barTintColor = [UIColor blueColor];
    self.navigationController.navigationBar.tintColor = tintColor;
    self.navigationController.navigationBar.barTintColor = barTintColor;
    [self.navigationController.navigationBar setTitleTextAttributes:@{                                                                      NSForegroundColorAttributeName:tintColor
                                                                  }];