-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathNextViewController.m
80 lines (66 loc) · 2.48 KB
/
NextViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//
// NextViewController.m
// MMPaperPanFlip
//
// Created by mukesh mandora on 18/12/14.
// Copyright (c) 2014 madaboutapps. All rights reserved.
//
#import "NextViewController.h"
#import "ViewController.h"
@interface NextViewController (){
UIActivityIndicatorView *activityIndicator;
}
@end
@implementation NextViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
// activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
// activityIndicator.alpha = 1.0;
// activityIndicator.color=[UIColor grayColor];
// activityIndicator.center = CGPointMake(160, 240);
// activityIndicator.hidesWhenStopped = YES;
// [self.view addSubview:activityIndicator];
// [activityIndicator startAnimating];
// // Do any additional setup after loading the view.
// self.webView.delegate = self;
// self.webView.scalesPageToFit = YES;
// NSURL* url = [NSURL URLWithString:@"http://marvel.com/movies/movie/193/avengers_age_of_ultron"];
// NSURLRequest* request = [NSURLRequest requestWithURL:url];
// [self.webView loadRequest:request];
// self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"next.png"]];
}
- (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.
}
*/
#pragma mark WebView Delegate
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
return YES;
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
[activityIndicator stopAnimating];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
- (IBAction)dismiss:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
@end