触摸事件

来源:互联网 发布:金拱门域名价格 编辑:程序博客网 时间:2024/06/04 19:52
// 开始的时候,手指摸到这个对象的时候- (void)touchesBegan:(NSSet<UITouch*>*)touches withEvent:(UIEvent*)event{    NSLog(@"%s", __func__);}// 移动的时候,手指在这个对象上移动- (void)touchesMoved:(NSSet<UITouch*>*)touches withEvent:(UIEvent*)event{    NSLog(@"%s", __func__);}// 结束的时候,手指在这个对象上离开- (void)touchesEnded:(NSSet<UITouch*>*)touches withEvent:(UIEvent*)event{    NSLog(@"%s", __func__);}// 取消,来电话的时候回取消触摸事件- (void)touchesCancelled:(NSSet<UITouch*>*)touches withEvent:(UIEvent*)event{    NSLog(@"%s", __func__);}