Skip to content

Instantly share code, notes, and snippets.

@leilee
Created January 9, 2017 12:49
Show Gist options
  • Save leilee/84a65dd92c335e5ace26066ea726a7a7 to your computer and use it in GitHub Desktop.
Save leilee/84a65dd92c335e5ace26066ea726a7a7 to your computer and use it in GitHub Desktop.
public struct Queues {
static var GlobalMainQueue: dispatch_queue_t {
return dispatch_get_main_queue()
}
static var GlobalUserInteractiveQueue: dispatch_queue_t {
return dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0)
}
static var GlobalUserInitiatedQueue: dispatch_queue_t {
return dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0)
}
static var GlobalDefaultQueue: dispatch_queue_t {
return dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0)
}
static var GlobalUtilityQueue: dispatch_queue_t {
return dispatch_get_global_queue(QOS_CLASS_UTILITY, 0)
}
static var GlobalBackgroundQueue: dispatch_queue_t {
return dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment