How can I pass additional parameters to a selector @objc function in Swift 5?
What I would like to do is this:
@objc func sendLike(_ sender: Any, checkin: String) {
createLikeCheckin(checkin: checkin) // This is the URLSession function
}
// In tableView cellForRowAt
let checkin = self.userCheckins[indexPath.row]
cell.likeButton.addTarget(self, action: #selector(sendLike(_:, checkin: checkin.pk)), for: .touchUpInside)
So I can pass the checkin object's pk to then use in a URLSession. However I get the error: Missing argument for parameter #1 in call Insert '<#Any#>, '
which leads me to this error after selecting fix: Argument of '#selector' does not refer to an '@objc' method, property, or initializer