,当我把一些代码在我的自定义按钮自定义按钮touchUpInside事件不火
注意我的自定义按钮touchupinside事件不火:当我在按键敲击这种方法很火,但touchUpInside方法不火
- (void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
NSLog(@"touchBegan");
[Singleton playSoundForEvent:Sound_ButtonTap];
}
如果我删除上面的代码,然后工作正常。
上面的代码原因:我没有在touchupinside处处放点击声音。 我只想在整个项目中使用一行代码。
的touchesBegan呼吁每UIcontrols那么你将如何处理这个 –
@ Anbu.Karthik请检查下面的答案,这将沃金对我很好,所以我的问题已经解决了。 – Vivek