I am developing a app in which I have a view which contains subView in it. I want to track both swipe and tap actions such as a single click.
Actions should be tracked
You can use UITapGestureRecognizer for tap gestures.
"UITapGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for single or multiple taps. For the gesture to be recognized, the specified number of fingers must tap the view a specified number of times."
This method includes the numberOfTapsRequired
("The number of taps for the gesture to be recognized.") and numberOfTouchesRequired
("The number of fingers required to tap for the gesture to be recognized") properties where you can set exactly how you want it to react to user action.
In this case, as you only want it to be activated when tapped once, the default settings for both these properties (both have default values of 1) should be fine.