在 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所以我必须创建一个名为BackgroundTouchLayerControllercall的单独类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。
有谁知道,可能出了什么问题?
我已经尽力说清楚了,如果还有什么需要请问我。
提前致谢