                         MBProgressHUD.hideHUDForView(self.view, animated: true)
                         self.tableView.reloadData()
                         self.networkErrorAlert.hidden = true
+                        if let refreshControl = refreshControl {
+                            refreshControl.endRefreshing()
+                        }
                     }
                 } else {
+                    MBProgressHUD.hideHUDForView(self.view, animated: true)
                     self.networkErrorAlert.hidden = false
                 }
         })
         task.resume()
     }
-
 }

    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        tableView.dataSource = self
        tableView.delegate = self

        detailViewController.movie = movie
    }
    
    func networkRequest(refreshControl: UIRefreshControl? = nil) {
        let apiKey = "a07e22bc18f5cb106bfe4cc1f83ad8ed"
        let url = NSURL(string: "http://api.themoviedb.org/3/movie/\(endpoint)?api_key=\(apiKey)")
        let request = NSURLRequest(URL: url!)
