按钮按下和抬起的时间差可以用
///长按开始绝对时间
@property(nonatomic,assign)CFAbsoluteTime touchTime;
///长按开始
if(sender.state ==UIGestureRecognizerStateEnded){ ///获取结束的时间
CFAbsoluteTime over =CFAbsoluteTimeGetCurrent() -self.touchTime;
///判断是否要结束
if(over>0.4){
///当时间大于0.4结束
}
}elseif(sender.state ==UIGestureRecognizerStateBegan){
//开始时间
CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
self.touchTime = start;
}
//开始时间
CFAbsoluteTime start = CFAbsoluteTimeGetCurrent();
// 记录结束时间
NSLog(@"%f",CFAbsoluteTimeGetCurrent() - start);