Hi I have two arrays and only one array is updating with search bar.. I keep the TitleArray to show in tableView title and detailsArray to show in tableView subtitle.. once I start searching only title following my typing but subtitle nothing change.

@IBOutlet weak var AirportsTableView: UITableView!

```
var TitleArray = [String]()
var DetailsArray = [String]()

var NumberOfRows = 0

var filteredNamesArray = [String]()
var filteredDetailsArray = [String]()
var resultSearchController = UISearchController!()

**override func viewDidLoad() {
    super.viewDidLoad()**

    // Do any additional setup after loading the view.

    self.resultSearchController = UISearchController(searchResultsController: nil)
    self.resultSearchController.searchResultsUpdater = self

    self.resultSearchController.dimsBackgroundDuringPresentation = false
    self.resultSearchController.searchBar.sizeToFit()
    self.resultSearchController.loadViewIfNeeded()

    self.AirportsTableView.tableHeaderView = self.resultSearchController.searchBar

    self.AirportsTableView.reloadData()

    parseJSON()

}

func parseJSON() {

    if let path = NSBundle.mainBundle().pathForResource("airports", ofType: "json") {
        do {
            let data = try NSData(contentsOfURL: NSURL(fileURLWithPath: path), options: NSDataReadingOptions.DataReadingMappedIfSafe)
            let jsonObj = JSON(data: data)
            if jsonObj != JSON.null {
            // print("jsonData:\(jsonObj)")

                NumberOfRows = jsonObj.count

                for i in 0...NumberOfRows {

                    let City = jsonObj[i]["city"].string as String!
                    let Country = jsonObj[i]["country"].string as String!
                    let Iata = jsonObj[i]["iata"].string as String!
                    let Name = jsonObj[i]["name"].string as String!

                    self.TitleArray.append("\(City) - \(Country) - \(Iata)")
                    self.DetailsArray.append("\(Name)")

                }

            } else {
                print("could not get json from file, make sure that file contains valid json.")
            }
        } catch let error as NSError {
            print(error.localizedDescription)
        }
    } else {
        print("Invalid filename/path.")
    }

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    // Get the new view controller using segue.destinationViewController.
    // Pass the selected object to the new view controller.
}
*/

// MARK: - Table view data source

func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    // #warning Incomplete implementation, return the number of sections

    return 1
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    // #warning Incomplete implementation, return the number of rows

    if self.resultSearchController.active

    {
        return self.filteredNamesArray.count

    } else

    {

        return self.TitleArray.count
    }
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

    let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell?

    if self.resultSearchController.active
    {
        cell!.textLabel?.text = self.filteredNamesArray[indexPath.row]

    } else
    {
        cell!.textLabel?.text = self.TitleArray[indexPath.row]
        cell!.detailTextLabel?.text = self.DetailsArray[indexPath.row]
    }

    return cell!
}

func updateSearchResultsForSearchController(searchController: UISearchController) {

    self.filteredNamesArray.removeAll(keepCapacity: false)

    let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@", searchController.searchBar.text!)

    let array = (self.TitleArray as NSArray).filteredArrayUsingPredicate(searchPredicate)

    self.filteredNamesArray = array as! [String]

    self.AirportsTableView.reloadData()
}

// MARK: - Segues

/*

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    if segue.identifier == "AirportDetails" {
        if let indexPath = self.AirportsTableView.indexPathForSelectedRow {
            let airportDetail : Airports = TitleArray[indexPath.row]
            let controller = (segue.destinationViewController as! UINavigationController).topViewController as! AllWaysFlightsViewController
            controller.airportDetail = airportDetail
            controller.navigationItem.leftBarButtonItem = self.splitViewController?.displayModeButtonItem()
            controller.navigationItem.leftItemsSupplementBackButton = true
        }
    }
}

*/

```