1、按钮点击之后,不能再被点击;过一秒钟后,恢复。
sender.enabled = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
sender.enabled = YES;
});
1、按钮点击之后,不能再被点击;过一秒钟后,恢复。
sender.enabled = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
sender.enabled = YES;
});
本文标题:iOS 按钮防止重复点击
本文链接:https://www.haomeiwen.com/subject/pugqdctx.html
网友评论