Class: UIView
- Inherits:
-
Object
- Object
- UIView
- Defined in:
- motion/ui/gestures.rb
Overview
Opens UIView to add methods for working with gesture recognizers.
Instance Method Summary (collapse)
- - (Object) whenPanned(enableInteraction = true, &proc)
- - (Object) whenPinched(enableInteraction = true, &proc)
- - (Object) whenPressed(enableInteraction = true, &proc)
- - (Object) whenRotated(enableInteraction = true, &proc)
- - (Object) whenSwiped(enableInteraction = true, &proc)
- - (Object) whenTapped(enableInteraction = true, &proc)
Instance Method Details
- (Object) whenPanned(enableInteraction = true, &proc)
21 22 23 |
# File 'motion/ui/gestures.rb', line 21 def whenPanned(enableInteraction=true, &proc) addGestureRecognizerHelper(proc, enableInteraction, UIPanGestureRecognizer.alloc.initWithTarget(proc, action:'call')) end |
- (Object) whenPinched(enableInteraction = true, &proc)
9 10 11 |
# File 'motion/ui/gestures.rb', line 9 def whenPinched(enableInteraction=true, &proc) addGestureRecognizerHelper(proc, enableInteraction, UIPinchGestureRecognizer.alloc.initWithTarget(proc, action:'call')) end |
- (Object) whenPressed(enableInteraction = true, &proc)
25 26 27 |
# File 'motion/ui/gestures.rb', line 25 def whenPressed(enableInteraction=true, &proc) addGestureRecognizerHelper(proc, enableInteraction, UILongPressGestureRecognizer.alloc.initWithTarget(proc, action:'call')) end |
- (Object) whenRotated(enableInteraction = true, &proc)
13 14 15 |
# File 'motion/ui/gestures.rb', line 13 def whenRotated(enableInteraction=true, &proc) addGestureRecognizerHelper(proc, enableInteraction, UIRotationGestureRecognizer.alloc.initWithTarget(proc, action:'call')) end |
- (Object) whenSwiped(enableInteraction = true, &proc)
17 18 19 |
# File 'motion/ui/gestures.rb', line 17 def whenSwiped(enableInteraction=true, &proc) addGestureRecognizerHelper(proc, enableInteraction, UISwipeGestureRecognizer.alloc.initWithTarget(proc, action:'call')) end |
- (Object) whenTapped(enableInteraction = true, &proc)
5 6 7 |
# File 'motion/ui/gestures.rb', line 5 def whenTapped(enableInteraction=true, &proc) addGestureRecognizerHelper(proc, enableInteraction, UITapGestureRecognizer.alloc.initWithTarget(proc, action:'call')) end |