在 myRootViewController 我有UIPanGesture
,UIPinchGesture
并UITapGesture
添加到myScrollView
.
-(void)viewDidLoad
{
//scroller's pan gesture
[scroller.panGestureRecognizer addTarget:self action:@selector(performScrollViewPanGesture:)];
//scroller's tap gesture
tapToEdit = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(performTapGesture:)];
tapToEdit.numberOfTapsRequired = 1.0;
[scroller addGestureRecognizer:tapToEdit];
//scroller's pinch gesture
pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(performPinchGesture:)];
[scroller addGestureRecognizer:pinchGesture];
}
因为我添加了手势myScrollView
,所以它不是调用ToucehsBegan
,但我也想用它ToucehsBegan
来执行一些转换,touchesMoved
所以我必须创建一个名为BackgroundTouchLayerController
call的单独类TouchesBegan
,它是的子类,UIScrolView
我将它分配给myScrollView
。
在myScrollView
课堂BackgroundTouchLayer
上我所做的就是这样。
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//start Transformation of my Layers
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
//continues Tranforation
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
//perform ending Animation
}
现在,它确实TouchesBegan
总是调用我的转换,我面临的问题是,当我在其中运行我的应用程序iPhone Retina-4 [iPhone 5] (simulator)
并执行Pan gesture
时,它调用我的Pan gesture handler
并正确执行所有操作。但是当我在中运行我的应用程序iPhone [iPhone 4] (simulator)
并执行Pan Gesture
时,它不会调用Pan gesture handler
类似的方法iPhone 5
,而是调用类中TouchesBegan
的方法myScrollView
。
有谁知道,可能出了什么问题?
我已经尽力说清楚了,如果还有什么需要请问我。
提前致谢