-
Notifications
You must be signed in to change notification settings - Fork 0
/
PFWebVC.swift
58 lines (42 loc) · 1.39 KB
/
PFWebVC.swift
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
//
// PFWebVC.swift
// PocketFriend
//
// Created by Manish Parihar on 16/11/16.
//
import UIKit
class PFWebVC: BaseViewController, UIWebViewDelegate {
var urlString : String = String()
var urlRequest : NSURLRequest = NSURLRequest()
@IBOutlet var webView: UIWebView!
@IBOutlet var activity: UIActivityIndicatorView!
//MARK: - View Controller Life Cycle Methods
override func viewDidLoad() {
super.viewDidLoad()
self.screenDesigningOfWebVC()
}
override func didReceiveMemoryWarning()
{
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
//MARK: - Screen Designing Methods
func screenDesigningOfWebVC(){
rightHeaderButton.isHidden = true
self.webView.loadRequest(urlRequest as URLRequest)
}
// func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {
// activity.startAnimating()
// return true
// }
//MARK: - WebViewDelegate Methods
func webViewDidStartLoad(_ webView: UIWebView) {
activity.startAnimating()
}
func webViewDidFinishLoad(_ webView: UIWebView) {
activity.stopAnimating()
}
func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
activity.stopAnimating()
}
}