读书人

iphone开发中怎么判断长按事件

发布时间: 2012-07-27 11:03:00 作者: rapoo

iphone开发中如何判断长按事件

?

如题,在iphone开发中,如何判断长按事件呢?

?

1.?UILongPressGestureRecognizer

?

2.在touchBegan里面[self performSelector:@selector(longPressMethod:) withObject:nil afterDelay:longPressTime]
然后在 end 或cancel里做判断,如果时间不够长按的时间调用 [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(longPressMethod:) object:nil]取消began里的方法

读书人网 >Iphone

热点推荐