I am trying to pass the multiple parameters to the UIButton selector in the swift3 code like below:
func openMaps(longitude: CGFloat, latitiude: CGFloat) {
let googleMapsInstalled = UIApplication.shared.canOpenURL(URL(string: "comgooglemaps://")!)
var latitude = 29.2746
var longitude = 47.8433
if googleMapsInstalled {
if #available(iOS 10.0, *) {
UIApplication.shared.open(URL(string: "comgooglemaps-x-callback://" +
"?daddr=\(latitude),\(longitude)&directionsmode=bicycling&zoom=17")!)
} else {
}
} else {
Utility.showAlert(title: Constants.error, message: Constants.someThingWrong, delegate: self)
}
}
For calling this function i am using the uibutton selector like this:
cell.viewInMap.addTarget(self, action: #selector(openMaps(longitude:shop.longitude!,latitiude:shop.latitude!)), for: .touchUpInside)
But i am getting the following error:
How to pass the multiple arguments to the UIButton selector? Where i am wrong?