Search
Search for a Location
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate {
...
}var searchResult:[MPLocation]?
lazy var destinationSearch:UISearchBar = UISearchBar.init(frame: CGRect.init(x: 0, y: 40, width: 0, height: 0))
var tableView = UITableView.init(frame: CGRect.init(x: 0, y: 90, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))override func viewDidLoad(){
destinationSearch.sizeToFit()
self.destinationSearch.delegate = self
self.view.addSubview(destinationSearch)
tableView.dataSource = self
tableView.delegate = self
...
}Expected Result
Last updated
Was this helpful?
