As long as you are tapping on the button, the action should be performed. As soon as you release the button, the action that is performed will be removed.
I am using a long-press Gesture but it didn't work.
let longGesture = UILongPressGestureRecognizer(target: self, action: #selector(long))
@objc func long() {
topImageView.image = originalImage
topImageView.isHidden = false
lassoimageView.isHidden = true
middleImageView.isHidden = true
overlayImage.isHidden = true
buttonTap = "Eye"
}