I'm using Xcode 8 and swift 3. I have the following error on line "let action": #selector' refers to a method that is not exposed to Objective-C Any suggestion ?
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cellWaze", for: indexPath) as! WazeTableViewCell
// Configure the cell...
cell.lbAgence.text = aWAgence[indexPath.row][0] as? String
let cellLat :Double = aWAgence[indexPath.row][1] as! Double
let cellLong :Double = aWAgence[indexPath.row][2] as! Double
cell.bWaze.tag = indexPath.row
let action = #selector(LaunchWaze(cellLat,longitude: cellLong))
cell.bWaze.addTarget(self, action: action, for: .touchUpInside)
return cell
}
@objc func LaunchWaze(_ latitude: Double, longitude: Double) {
if UIApplication.shared.canOpenURL(NSURL(string: "waze://")! as URL) {
// Waze is installed. Launch Waze and start navigation
var urlStr = "waze://?ll=\(latitude),\(longitude)&navigate=yes"
print("url : \(urlStr)")
//UIApplication.shared.openURL(NSURL(string: urlStr)!)
}
else {
// Waze is not installed. Launch AppStore to install Waze app
UIApplication.shared.openURL(NSURL(string: "http://itunes.apple.com/us/app/id323229106")! as URL)
}
}