目前[NSRunLoop -performSelector:target:argument:order:modes:]
在Swift中没有。也是[NSObject -performSelector:withObject:afterDelay:]
。如何安排一段代码在Swift的下一个运行循环中执行?
我想出了办法。只需使用NSOperationQueue在主队列上排队基于块的操作即可。
NSOperationQueue.mainQueue().addOperationWithBlock {[unowned self] () -> Void in
// Do your things
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句