func delay(delay:Double, closure:()->()) { dispatch_after( dispatch_time( DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC)) ), dispatch_get_main_queue(), closure) } //And now you can talk like this: delay(0.4) { // do stuff }

 

posted on 2014-07-13 00:02  David@_@  阅读(497)  评论(0编辑  收藏  举报