Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- func delay(delay:Double, closure:()->()) {
- dispatch_after(
- dispatch_time(
- DISPATCH_TIME_NOW,
- Int64(delay * Double(NSEC_PER_SEC))
- ),
- dispatch_get_main_queue(), closure)
- }
- func async(closure:()->()) {
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), closure)
- }
- func main(closure:()->()) {
- dispatch_async(dispatch_get_main_queue(), closure)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement