There are several examples of the UIPanGestureRecognizer
class. For example I have read this and I am still not able to use it...
On the nib file that I am working on I have a UIView
(white rectangle on image) that I wish to drag with that class:
and in my .m file I have placed:
- (void)setTranslation:(CGPoint)translation inView:(UIView *)view
{
NSLog(@"Test to see if this method gets executed");
}
and that method does not get executed when I drag the mouse across the UIView
. I have also tried placing:
- (void)pan:(UIPanGestureRecognizer *)gesture
{
NSLog(@"testing");
}
And that method does not get executed either. Maybe I am wrong but I think this methods should work like the - (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
method where I just have to place that method and it will get called whenever there are touches.
What am I doing wrong? Maybe do I have to draw a connection to that method? If so how can I do that?