Answers for "how swiftui image on tap gesture"

0

uiimageview add tap gesture swift

override func viewDidLoad()
{
    super.viewDidLoad()

    let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(imageTapped(tapGestureRecognizer:)))
    imageView.isUserInteractionEnabled = true
    imageView.addGestureRecognizer(tapGestureRecognizer)
}

@objc func imageTapped(tapGestureRecognizer: UITapGestureRecognizer)
{
    let tappedImage = tapGestureRecognizer.view as! UIImageView

    // Your action
}
Posted by: Guest on February-16-2020

Code answers related to "how swiftui image on tap gesture"

Code answers related to "Swift"

Browse Popular Code Answers by Language