-(void)timeEnough:(UIButton *)btn
{
btn.selected = NO;
}
-(void)btnClick:(UIButton *)btn
{
if (btn.selected)return;
btn.selected = YES;
[self performSelector:@selector(timeEnough:) withObject:nil afterDelay:3.0];
//你要实现的button点击事件
}
这样的效果就是该button在3秒内只能触发一次点击事件,防止button点击频率过快.
时间: 2024-11-09 00:46:59