Do not use extra type.
Declare an optional empty array.
var searchResults : [[String : AnyObject]]()
then numberOfRowsInSection might just be
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return searchResults.count }
To clear the table view, write
searchResults.removeAll() tableView.reloadData()
No deployment, no verification for nil , no problem.
source share