static NSTimeInterval time = 0.0;
NSTimeInterval currentTime = [NSDate date].timeIntervalSince1970; //限制用户点击按钮的时间间隔大于1秒钟
if (currentTime - time > 1) { //处理逻辑
//拨打电话
NSString *callPhone = @"tel:010-67882123";
CGFloat version = [[[UIDevice currentDevice]systemVersion]floatValue];
if (version >= 10.0) { /// 大于等于10.0系统使用此openURL方法
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone] options:@{} completionHandler:nil]; }
else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
}
}
time = currentTime;
NSTimeInterval currentTime = [NSDate date].timeIntervalSince1970; //限制用户点击按钮的时间间隔大于1秒钟
if (currentTime - time > 1) { //处理逻辑
//拨打电话
NSString *callPhone = @"tel:010-67882123";
CGFloat version = [[[UIDevice currentDevice]systemVersion]floatValue];
if (version >= 10.0) { /// 大于等于10.0系统使用此openURL方法
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone] options:@{} completionHandler:nil]; }
else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
}
}
time = currentTime;