Questions tagged «dispatch-after»


6
如何在Swift 3中编写延迟程序
在早期版本的Swift中,可以使用以下代码创建延迟: let time = dispatch_time(dispatch_time_t(DISPATCH_TIME_NOW), 4 * Int64(NSEC_PER_SEC)) dispatch_after(time, dispatch_get_main_queue()) { //put your code which should be executed with a delay here } 但现在,斯威夫特3时,Xcode自动改变6个不同的东西,但随后出现以下错误:“无法转换DispatchTime.now到预期值dispatch_time_t又名UInt64”。 在Swift 3中运行一系列代码之前,如何创建延迟?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.