12345678910111213141516171819202122232425262728293031323334353637 |
- import Foundation
- typealias Dispatch = DispatchQueue
- extension Dispatch {
-
- static func background(_ task: @escaping () -> ()) {
- Dispatch.global(qos: .background).async {
- task()
- }
- }
-
- static func main(_ task: @escaping () -> ()) {
- Dispatch.main.async {
- task()
- }
- }
-
- }
|