OC中
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (complete) {
complete();
}
});
Swift中
let delayTime = DispatchTime.now() + DispatchTimeInterval.seconds(3)
DispatchQueue.global().asyncAfter(deadline: delayTime) {
complete?()
}
网友评论