     }
     
     func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
-        searchSuggestionsHidden = true
+        updateViewModeFromSegmentedControl()
     }
     
     // MARK: UITableViewDataSource

        }
    }
    
    func segmentedControlChanged() {
        switch segmentedControl.selectedSegmentIndex {
        case 0:
            listView.isHidden = true
        default:
            deselectAllAnnotations()
            listView.isHidden = false
            updateDistanceFromUserOnVisibleCells()
        }
    }
    

        segmentedControl = UISegmentedControl(items: [map, list])
        
        segmentedControl.selectedSegmentIndex = 0
        segmentedControl.addTarget(self, action: #selector(updateViewModeFromSegmentedControl), for: .valueChanged)
        segmentedControl.tintColor = UIColor.wmf_blueTint()
        segmentedControlBarButtonItem = UIBarButtonItem(customView: segmentedControl)
        navigationItem.rightBarButtonItem = segmentedControlBarButtonItem
