• Blog
  • Categories
    • App Store
    • Benchmarks
    • iOS
    • Objective-C
    • OS X
    • PHP
    • RV
    • Swift
    • tvOS
    • Web
  • Apps
    • Portfolio
    • Studio Pro
    • Sun & Moon
  • Photography

Projects

Remote Working, iOS, Mac OS X, and more

Swift

GCD Sugar for Swift →

Async sugar looks like this:

Async.background {
println("This is run on the background queue")
}.main {
println("This is run on the main queue, after the previous block")
}

Instead of the familiar syntax for GCD:

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), {
    println("This is run on the background queue")

        dispatch_async(dispatch_get_main_queue(), {
            println("This is run on the main queue, after the previous block")
        })
})
  • Newer Posts
  • 1
  • …
  • 85
  • 86
  • 87
  • 88
  • 89
  • …
  • 106
  • Older Posts

Copyright 2025 Ryan Britton