//
//  WebViewco.m
//  socialSecurity
//
//  Created by 看看智能 on 2017/6/21.
//  Copyright © 2017年 黄江涛 . All rights reserved.
//

#import "WebViewco.h"

@interface WebViewco ()<UIWebViewDelegate>

@end

@implementation WebViewco

- (void)viewDidLoad {
    [super viewDidLoad];

    NSURLRequest *request =[NSURLRequest requestWithURL:self.urlStr];
    
    self.webView.delegate=self;
    self.webView.scalesPageToFit =YES;
[self.webView loadRequest:request];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)webViewDidStartLoad:(UIWebView *)webView{
    //开始加载网页
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
    [SVProgressHUD dismiss];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    //加载网页成功
    [SVProgressHUD dismiss];
    
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
    

    
    
    
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nonnull NSError *)error{
    //加载网页失败
    SVProgressHUD.minimumDismissTimeInterval=2;
    //[SVProgressHUD  showErrorWithStatus:@"加载失败,检查网络"];
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
}


-(void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
    [SVProgressHUD dismiss];
}
- (IBAction)closeButton:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end
