我用这个代码搜索
extension PlacesVC : UISearchBarDelegate {
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
places = places.filter("name CONTAINS[cd] %@", searchBar.text)
table.reloadData()
}
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
if searchBar.text?.count == 0 {
DispatchQueue.main.async {
searchBar.resignFirstResponder()
}
}
}
}
我不断得到
通话中的额外参数
有谁知道我错过了什么以及如何阻止它?
var places = [["lat": "40.718081110553925", "name": "59 Leonard St", "lon": "-74.00565161821724"], ["lat": "40.87124295389947", "name": "66 Lawrence Ave", "lon": "-74.0764477654279"], ["lat": "40.82326949018643", "name": "685 Fairview Ave", "lon": "-74.00056756991113"]]