Ios CAEmitterLayer-禁用触摸动画

Ios CAEmitterLayer-禁用触摸动画,ios,objective-c,calayer,Ios,Objective C,Calayer,我正在尝试将CAEmitterLayer动画添加到我的应用程序中。在模拟器上进行测试时,一切正常,但是如果我在设备上运行代码,并且我开始触摸屏幕,那么额外的细胞会完全脱离我设置的出生率。是否有办法禁用/概述此触摸事件?我试图加上: - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event OR - (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

我正在尝试将CAEmitterLayer动画添加到我的应用程序中。在模拟器上进行测试时,一切正常,但是如果我在设备上运行代码,并且我开始触摸屏幕,那么额外的细胞会完全脱离我设置的出生率。是否有办法禁用/概述此触摸事件?我试图加上:

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event OR - (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event -(无效)触摸开始:(NSSet*)触摸事件:(UIEvent*)事件 或 -(无效)触摸移动:(NSSet*)触摸事件:(UIEvent*)事件
但这没有帮助。似乎触摸是从不同的“层”获取的。

Calayer不是UIResponder链的一部分,因此不能自己接收触摸事件。你的应用程序的视图层次结构是什么样子的?@ArtGillespie这是一个简单的应用程序,上面有一个UIViewController和一个视图。在ViewDidDisplay()方法上,通过调用:[self.view.layer addSublayer:MyMitter]添加CAEmitterLayer]