覆盖-handlePan:在UIScrollView中

Alt*_*ice 5 cocoa-touch uiscrollview ipad

是否可以覆盖-handlePan:在UIScrollView子类中?即我的应用程序不会被应用程序商店拒绝?

感谢您分享您的观点.

编辑:如何调用-handlePan:在我的子类的另一个方法?

Alt*_*ice 8

如果有人感兴趣,我所做的而不是覆盖是禁用默认的UIPanGestureRecognizer并添加另一个UIPanGestureRecognizer实例,该实例映射到我的自定义处理程序.

编辑twerdster:

我是这样做的

//disables the built-in pan gesture
for (UIGestureRecognizer *gesture in scrollView.gestureRecognizers){
  if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]){
    gesture.enabled = NO;
  }
}

//add your own
UIPanGestureRecognizer *myPan = [[UIPanGestureRecognizer alloc] init...];
//customize myPan here
[scrollView addGestureRecognizer:myPan];
[myPan release];
Run Code Online (Sandbox Code Playgroud)