// // ADLinkVC.m // jiaPei // // Created by apple on 16/4/26. // Copyright © 2016年 JCZ. All rights reserved. // #import "ADLinkVC.h" #import @interface ADLinkVC () @end @implementation ADLinkVC - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor whiteColor]; [self configNavigationBar]; self.tabBarController.tabBar.hidden = YES; if (_urlString.length > 0) { [self creatWebView]; } } -(void)creatWebView { WKWebView *view = [[WKWebView alloc] initWithFrame:kFrame]; view.height = kSize.height - kNavOffSet; view.navigationDelegate = self; [self.view addSubview: view]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:_urlString]]; if (![Util connectedToNetWork]) { showMsgUnconnect(); return; } [MBProgressHUD showLoadToView:self.view]; [view loadRequest:request]; } #pragma mark - // 页面加载失败时调用 - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(null_unspecified WKNavigation *)navigation withError:(NSError *)error{ [MBProgressHUD hideHUDForView:self.view]; } // 页面加载完毕时调用 - (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation{ [MBProgressHUD hideHUDForView:self.view]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end