Reputation: 10144
I used this code many times but in my current project it isn't working. Here is the error (third line): "No visible @interface for 'UIGestureRecognizer' declares the selector 'translationInView:'
and my simple code:
- (IBAction)panLayer:(UIGestureRecognizer *)pan{
if (pan.state == UIGestureRecognizerStateChanged) {
CGPoint point = [pan translationInView:self.view];
CGRect frame = self.settingsView.frame;
frame.origin.y = self.layerPosition + point.y;
if (frame.origin.y < 0) {
frame.origin.y = 0;
}
}
Upvotes: 0
Views: 719
Reputation: 5409
You are looking for the UIPanGestureRecognizer that has UIGestureRecognizer as the parent class.
- (IBAction)panLayer:(UIPanGestureRecognizer *)pan{
}
Upvotes: 1