 extension StationsViewController: UITableViewDataSource {
     
     // MARK: - Table view data source
-    func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
-        return 88
-    }
-    
-    func numberOfSectionsInTableView(tableView: UITableView) -> Int {
+    @objc(tableView:heightForRowAtIndexPath:)
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 88.0
+    }
+    
+    func numberOfSections(in tableView: UITableView) -> Int {
         return 1
     }
     
-    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         
         // The UISeachController is active
-        if searchController.active {
+        if searchController.isActive {
             return searchedStations.count
             
         // The UISeachController is not active

        // If a track is playing, display title & artist information and animation
        if currentTrack != nil && currentTrack!.isPlaying {
            let title = currentStation!.stationName + ": " + currentTrack!.title + " - " + currentTrack!.artist + "..."
            stationNowPlayingButton.setTitle(title, forState: .Normal)
            nowPlayingAnimationImageView.startAnimating()
        } else {
            nowPlayingAnimationImageView.stopAnimating()


extension StationsViewController: UISearchResultsUpdating {

    func updateSearchResults(for searchController: UISearchController) {
    
        // Empty the searchedStations array
        searchedStations.removeAll(keepingCapacity: false)
    
        // Create a Predicate
        let searchPredicate = NSPredicate(format: "SELF.stationName CONTAINS[c] %@", searchController.searchBar.text!)
    
        // Create an NSArray with a Predicate
        let array = (self.stations as NSArray).filtered(using: searchPredicate)
    
        // Set the searchedStations with search result array
        searchedStations = array as! [RadioStation]
