美文网首页📚苹果
iOS 防止按钮多次点击&延迟的执行与取消

iOS 防止按钮多次点击&延迟的执行与取消

作者: JohnayXiao | 来源:发表于2018-03-08 09:03 被阅读159次
//这里是关键,点击按钮后先取消之前的操作,再进行需要进行的操作
        [[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(readEnglish) object:nil];
        [self performSelector:@selector(readEnglish)withObject:nil afterDelay:0.75f];

相关文章

网友评论

    本文标题:iOS 防止按钮多次点击&延迟的执行与取消

    本文链接:https://www.haomeiwen.com/subject/nduefftx.html