小编cra*_*dev的帖子

如何防止iOS中同一个UIButton上的多个事件?

我希望防止连续多次点击UIButton.

我试过enabledexclusiveTouch属性但它没有用.如:

-(IBAction) buttonClick:(id)sender{
    button.enabled = false;
    [UIView animateWithDuration:1.0 delay:0.0 options:UIViewAnimationOptionAllowAnimatedContent animations:^{
        // code to execute
     }
     completion:^(BOOL finished){
         // code to execute  
    }];
    button.enabled = true;
}
Run Code Online (Sandbox Code Playgroud)

touch uibutton ios

8
推荐指数
1
解决办法
8828
查看次数

标签 统计

ios ×1

touch ×1

uibutton ×1