Tap is a gesture in which you quickly touch and remove the finger from the screen. There is a separate gesture recognizer for this as well.
To get ready, no additional work is required.
Similarly to the swipe gesture recognizer, we just have to assign a function that will get called once the gesture is recognized. Add the following code to the class:
UITapGestureRecognizer* tapGestureRecognizer = [[UITapGestureRecognizeralloc] initWithTarget:self action:@selector(handleTap:)]; [[UIApplicationsharedApplication].delegate.windowaddGestureRecognizer:tapGestureRecognizer];
Here, we will create a variable of the
UITapGestureRecognizer type, allocate and initialize it with a function, and set the delegate as ...