                                         print("response: \(responseDictionary)")
                                         self.movieData = responseDictionary["results"] as! [NSDictionary]
                                         self.movieTable.reloadData()
+                                        self.refreshControl.endRefreshing()
+                                        
                                     }
                                 }
             })
         task.resume()
     }
     
+    func setupRefreshControl() {
+        //refreshControl = UIRefreshControl()
+        refreshControl.addTarget(self, action: #selector(MoviesViewController.loadJsonData), for: UIControlEvents.valueChanged)
+        movieTable.insertSubview(refreshControl, at: 0)
+    }
+    
 }

    
    var selectedMovie = NSDictionary()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
        movieTable.delegate = self
        movieTable.dataSource = self
        
        self.loadJsonData()
    }
    
    override func didReceiveMemoryWarning() {

        
    }
    
    func loadJsonData() {
        let apiKey = "a07e22bc18f5cb106bfe4cc1f83ad8ed"
        let url = URL(string: "https://api.themoviedb.org/3/movie/now_playing?api_key=\(apiKey)")
        let request = URLRequest(
