         guard let text = self.searchController.searchBar.text,
             !text.trimmingCharacters(in: CharacterSet.whitespaces).characters.isEmpty
             else { return }
+        // TODO: Debounce.
         self.searchMapItems(withQuery: text)
     }
 

     Main search handler that makes a `MKLocalSearchRequest` and updates
     `resultsViewController`.

     For now, annotations get updated on `mapView` on search completion,
     despite latter not being visible. This is to avoid doing more work
     on dismissal.

     See [Apple docs](https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/EnablingSearch/EnablingSearch.html).
     */
    fileprivate func searchMapItems(withQuery query: String) {

    open func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        guard tableView === self.resultsViewController.tableView else { return }

        self.selectedMapItem = self.resultsViewController.mapItems[indexPath.row]
        let annotationToSelect = self.updateAnnotations()[indexPath.row]

        self.resultsViewController.dismiss(animated: true) {
            self.zoom(to: self.selectedMapItem!.placemark.location!, animated: false)
            self.mapView.selectAnnotation(annotationToSelect, animated: false)
        }
    }

}
