1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- //
- // ADLinkVC.m
- // jiaPei
- //
- // Created by apple on 16/4/26.
- // Copyright © 2016年 JCZ. All rights reserved.
- //
- #import "ADLinkVC.h"
- #import <WebKit/WebKit.h>
- #import <MBProgressHUD.h>
- @interface ADLinkVC ()<WKNavigationDelegate>
- @end
- @implementation ADLinkVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.view.backgroundColor = [UIColor whiteColor];
-
- self.tabBarController.tabBar.hidden = YES;
-
- if (_urlString.length > 0) {
-
- [self creatWebView];
- }
- }
- -(void)creatWebView
- {
- WKWebView *view = [[WKWebView alloc] initWithFrame:kFrame];
- view.navigationDelegate = self;
- [self.view addSubview: view];
- NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:_urlString]];
- [MBProgressHUD showHUDAddedTo:self.view animated:NO];
- [view loadRequest:request];
- }
- #pragma mark -
- // 页面加载失败时调用
- - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(null_unspecified WKNavigation *)navigation withError:(NSError *)error{
-
- [MBProgressHUD hideHUDForView:self.view animated:NO];
- }
- // 页面加载完毕时调用
- - (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation{
-
- [MBProgressHUD hideHUDForView:self.view animated:NO];
- }
- - (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
|