0

I am just trying out pinch gesture on UILabel but it's not working. When I applied the same to UIView it works.

Below is my code:

in viewDidLoad

UIPinchGestureRecognizer *pinchLabel = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchLabel:)];
[pinchLabel setDelegate:self];
[_lblDouble addGestureRecognizer:pinchLabel];

-(void)pinchLabel:(UIPinchGestureRecognizer *)recognizer{
NSLog(@"jhhj"); // method never gets called. I have a breakpoint here.
}

Why is it so? Where am I getting wrong?

Binarian
  • 12,296
  • 8
  • 53
  • 84
z22
  • 10,013
  • 17
  • 70
  • 126

1 Answers1

2

Maybe you should add below code. otherwise all code looks ok.

_lblDouble.userInteractionEnabled = YES;
ChintaN -Maddy- Ramani
  • 5,156
  • 1
  • 27
  • 48