0
0
iOS Swiftmobile~5 mins

Gesture recognition (drag, magnify, rotate) in iOS Swift - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AUITapGestureRecognizer
BUIPanGestureRecognizer
CUIRotationGestureRecognizer
DUIPinchGestureRecognizer
What does UIPinchGestureRecognizer detect?
APinch to zoom
BRotation
CTap
DSwipe
Which method adds a gesture recognizer to a view?
AaddGesture()
BsetGestureRecognizer()
CattachGesture()
DaddGestureRecognizer()
UIRotationGestureRecognizer detects which type of gesture?
ARotate
BPinch
CDrag
DTap
What is the first step to use a gesture recognizer in Swift?
AOverride the touch methods in UIView
BCall the gesture recognizer's start() method
CCreate the gesture recognizer and set target/action
DAdd gesture recognizer to the storyboard
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.