Passing arguments to selector in Swift
It looks like you’re misunderstanding a couple of things. When using target/action, the function signature has to have a certain form… func doSomething() or func doSomething(sender: Any) or func doSomething(sender: Any, forEvent event: UIEvent) where… The sender parameter is the control object sending the action message. In your case, the sender is the UITapGestureRecognizer Also, … Read more