Hi all,
The completion of performSearch given by performSearch() in SearchViewController class is
if let category = Search.Category(rawValue: segmentedControl.selectedSegmentIndex) {
search.performSearch(for: searchBar.text!,
category: category,
completion: { success in
if !success {
self.showNetworkError()
}
self.tableView.reloadData()
self.landscapeViewController?.searchResultsReceived()
})
tableView.reloadData()
searchBar.resignFirstResponder()
}
Is tableView.reloadData() is necessary if the screen goes to landscape? If not, why doesn’t use a if statement to call them separately according to different screen type(portrait or landscape )?