I have a array content of CLLocationcooridinate2d and location detail. And I put it on tableview cell with Uibutton, what Im doing is trying to pass the specific cell information by Uibuttom and start a new view of map view and began to navigation. Here is my code:
var tripspot:[tripSpot] = [
tripSpot( title: "一中商圈", coordinate: CLLocationCoordinate2DMake(24.149062, 120.684891), regionRadius: 300.0, location: "台中市北區一中街", type: "Food",cllocation:CLLocation(latitude: 24.181143, longitude: 120.593158))
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("MapCell") as! mapTableViewCell
if searchController.active{
cell.title.text = searchResults[indexPath.row].title
cell.location.text = searchResults[indexPath.row].location
cell.naviButton.tag = indexPath.row
cell.naviButton.addTarget(self, action: Selector("tapDidNavi"), forControlEvents: .TouchUpInside)
return cell
}else{
cell.title.text = tripspot[indexPath.row].title
cell.location.text = tripspot[indexPath.row].location
cell.naviButton.tag = indexPath.row
cell.naviButton.addTarget(self, action: Selector("tapDidNavi"), forControlEvents: .TouchUpInside)
print(cell.naviButton.tag.description)
return cell
}
}
@IBAction func tapDidNavi(sender: UIButton){
}
thanks for any advice!