Recall & Review
beginner
What is gesture recognition in iOS development?
Gesture recognition is the process of detecting and responding to user touch interactions like dragging, pinching to zoom (magnify), and rotating on the screen.
Click to reveal answer
beginner
Which UIKit class is used to detect drag gestures?UIPanGestureRecognizer is used to detect drag (pan) gestures where the user moves their finger across the screen.
Click to reveal answer
beginner
How does UIPinchGestureRecognizer help in gesture recognition?
UIPinchGestureRecognizer detects pinch gestures, allowing the app to recognize when the user is zooming in or out by moving two fingers closer or farther apart.
Click to reveal answer
beginner
What is the role of UIRotationGestureRecognizer?
UIRotationGestureRecognizer detects rotation gestures, letting the app know when the user rotates two fingers around a point on the screen.
Click to reveal answer
intermediate
How do you add a gesture recognizer to a UIView in Swift?
You create a gesture recognizer instance, set its target and action, then add it to the UIView using addGestureRecognizer(). For example: view.addGestureRecognizer(panGesture).
Click to reveal answer
Which gesture recognizer detects dragging motions?
✗ Incorrect
UIPanGestureRecognizer detects dragging or panning gestures.
What does UIPinchGestureRecognizer detect?
✗ Incorrect
UIPinchGestureRecognizer detects pinch gestures used for zooming in or out.
Which method adds a gesture recognizer to a view?
✗ Incorrect
addGestureRecognizer() is the correct method to add a gesture recognizer to a UIView.
UIRotationGestureRecognizer detects which type of gesture?
✗ Incorrect
UIRotationGestureRecognizer detects rotation gestures.
What is the first step to use a gesture recognizer in Swift?
✗ Incorrect
You first create the gesture recognizer and set its target and action before adding it to a view.
Explain how to implement drag, magnify, and rotate gestures on a UIView in Swift.
Think about creating recognizers, adding them to the view, and updating the view's transform.
You got /5 concepts.
Describe the user experience improvements when adding gesture recognition to a mobile app.
Consider how users interact with touchscreens in real life.
You got /4 concepts.