Skip to content

Instantly share code, notes, and snippets.

@jpiche
Created October 13, 2015 18:51
Show Gist options
  • Select an option

  • Save jpiche/64aab7e00185829400a7 to your computer and use it in GitHub Desktop.

Select an option

Save jpiche/64aab7e00185829400a7 to your computer and use it in GitHub Desktop.
//
// Threading.swift
//
import Foundation
private let priority = DISPATCH_QUEUE_PRIORITY_DEFAULT
func async(closure: () -> ()) {
dispatch_async(dispatch_get_global_queue(priority, 0), closure)
}
func main(closure: () -> ()) {
dispatch_async(dispatch_get_main_queue(), closure)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment