title: IOS: Add activity indicatior view in web view
body: <pre><code>    class ViewController: UIViewController , UIWebViewDelegate {
            var  webview = UIWebView()
            var boxView = UIView()
             @IBAction func webview(sender: UIButton) {
                   let activityView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray)        
                   activityView.frame = CGRect(x: 20, y: 12, width: 40, height: 40)
                   activityView.startAnimating()
                  webview.addSubview(activityView)
                  webview.reload()
                  let url = NSURL(string:"http://www.sugoilabs.com")
                         UIApplication.sharedApplication().openURL(url!)    
                  }
                  override func viewDidLoad() {
                        super.viewDidLoad()
                 // Do any additional setup after loading the view, typically from a nib.
                  }
                  func webViewDidStartLoad(webView_Pages: UIWebView) {
                        webview.delegate = self
                       // Box config:
                       boxView = UIView(frame: CGRect(x: 115, y: 110, width: 80, height: 80))
                       boxView.backgroundColor = UIColor.blackColor()
                       boxView.alpha = 1
                       boxView.layer.cornerRadius = 10
                      // Spin config:
                      let activityView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray)
                      activityView.frame = CGRect(x: 20, y: 12, width: 40, height: 40)
                      activityView.startAnimating()
                     // Text config:
                     let textLabel = UILabel(frame: CGRect(x: 0, y: 50, width: 80, height: 30))
                    textLabel.textColor = UIColor.blackColor()
                    textLabel.textAlignment = .Center
                    textLabel.font = UIFont(name: textLabel.font.fontName, size: 13)
                    textLabel.text = "Loading..."
  
                    // Activate:
                   boxView.addSubview(activityView)
                   boxView.addSubview(textLabel)
                   self.view.addSubview(boxView)
               }
              func webViewDidFinishLoad(webView_Pages: UIWebView) {
                    // Removes it:
                    boxView.removeFromSuperview()
  
             }
    }
  </code></pre>