UIKIT_CLASS_AVAILABLE(2_0) @interface UIView : UIResponder<NSCoding> {
@package
CALayer *_layer;
id _tapInfo;
id _gestureInfo;
NSMutableArray *_gestureRecognizers;
@interface UIView (UIViewGestureRecognizers)
@property(nonatomic,copy) NSArray *gestureRecognizers __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2);
- (void)addGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2);
- (void)removeGestureRecognizer:(UIGestureRecognizer*)gestureRecognizer __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2);
@end
- (void)viewDidLoad {
[super viewDidLoad];
UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc]
initWithTarget:self action:@selector(handlePinchGesture:)];
[self.view addGestureRecognizer:pinchGesture];
[pinchGesture release];
}
- (void)handlePinchGesture:(UIGestureRecognizer *)sender {
UIPinchGestureRecognizer *pinchGesture = (UIPinchGestureRecognizer *) sender;
NSLog(@"scale = %f", [pinchGesture scale]);
NSLog(@"velocity = %f", [pinchGesture velocity]);
if([pinchGesture velocity] > 0.0f) {
label.text = @"Outward Pinch";
}else {
label.text = @"Inward Pinch";
}
}