我多次使用此代码,但在我当前的项目中它不起作用。这是错误(第三行):“'UIGestureRecognizer'没有可见的@interface声明选择器'translationInView:'
和我的简单代码:
- (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;
}
}