我的应用程序允许用户在mapView上创建注释。用户可以通过3种方式创建注释:
在执行了其中一项操作后,显示了相同的View控制器,但是问题在于,最后一种方法是不显示导航栏,因此显示“后退”按钮。我知道这是因为显示结果并从中调用视图控制器的表视图本身不是由地图中的ShowSegue调用的。这是代码:
let locationSearchTable = storyboard!.instantiateViewController(withIdentifier: "LocationSearchTable") as! LocationSearchTable
locationSearchTable.user = self.user
resultSearchController = UISearchController(searchResultsController: locationSearchTable)
resultSearchController.searchResultsUpdater = locationSearchTable
let searchBar = resultSearchController!.searchBar
searchBar.sizeToFit()
searchBar.placeholder = "Entrer une adresse"
navigationItem.titleView = resultSearchController?.searchBar
resultSearchController.hidesNavigationBarDuringPresentation = false
resultSearchController.dimsBackgroundDuringPresentation = true
definesPresentationContext = true
locationSearchTable.mapView = mapView
locationSearchTable.handleMapSearchDelegate = self
searchBar.isHidden = true
对不起,如果我不清楚自己的意思!谢谢您的帮助