title: Stop and hide activity indicator when webpage has loaded
body: <p>I'm having problems getting my activity indicator to stop and hide once my webpage loads in my app.  Here is my code with the activityIndicator.stopAnimating() removed because everywhere I put it in my code prevents the indicator even starting.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>import UIKit
  
  class AppointmentsViewController: UIViewController {
  
      @IBOutlet weak var myWebView: UIWebView!
      @IBOutlet weak var activityIndicator: UIActivityIndicatorView!
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          if Reachability.isConnectedToNetwork(){
  
              webViewDidStartLoad(webView: myWebView)
  
              let url = URL(string: "https://www.posebeautysalon.com/appointment")!
  
              myWebView.loadRequest(URLRequest(url: url))
  
          }
          else{
              print("Internet Connection not Available!")
  
              let alertController = UIAlertController(title: "No Internet Connection", message: "Make sure your device is connected to the internet.", preferredStyle: .alert)
  
              // Create the actions
              let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.default) {
                  UIAlertAction in
                  NSLog("OK Pressed")
  
              }
  
              // Add the actions
              alertController.addAction(okAction)
  
              // Present the controller
              self.present(alertController, animated: true, completion: nil)
          }
  
      }
  
      func webViewDidStartLoad(webView: UIWebView) {
          activityIndicator.startAnimating()
          NSLog("The webview is starting to load")
      }
  
      func webViewDidFinishLoad(webView: UIWebView) {
          activityIndicator.stopAnimating()
          activityIndicator.isHidden=true;
          NSLog("The webview is done loading")
      }
  
  }
  </code></pre>