I write with Swift 4 and try to write a function that send categoryId as action but I couldn't write .I think my syntax is wrong.If I write function without parameters its not a problem but I get error with parameters functions. Could you say me how to use selector?
@objc func sendCategoryIdToPackageSelectionVC(categoryId : Int){
MarketVC.categoryId = categoryId
self.performSegue(withIdentifier: "sequeGoToPackageSelection", sender: nil)
}
func addTapFeatures(){
taplabel1 = UITapGestureRecognizer(target: self, action: #selector(self.sendCategoryIdToPackageSelectionVC(categoryId:2)))
taplabel1?.cancelsTouchesInView = false
self.labelFirst.addGestureRecognizer(taplabel1!)
}
I get an error saying that the action selector doesn't refer to any objc method.