版权声明: https://blog.csdn.net/baidu_33440774/article/details/81281332
1、使用此方法,进行防连点操作,有一个弊端,就是会让实际操作延迟执行
@objc private func submitAction() {
print("submitAction")
self.classForCoder.cancelPreviousPerformRequests(withTarget: self, selector: #selector(submitOrder), object: self)
self.perform(#selector(submitOrder), with: self, afterDelay: 1)
}
2、使用UIButton的enabled或userInteractionEnabled属性,操作开始执行后,属性设置为false,执行完成设置为true
3、使用runtime,详情请查看链接https://blog.csdn.net/baidu_33440774/article/details/81285105