In the past I’ve mentioned a few resources simplifying the se of Grand Central Dispatch with Objective-C, but as of yet have not mentioned a helper library for working with GCD in Swift.
Here’s an open source library from TheHolyGrail providing a concise syntax for working with GCD using Swift language features.
KillerRabbit provides abstractions of the dispatch_, dispatch_queue, dispatch_block, dispatch_group, dispatch_source, and dispatch_semaphore aAPIs.
This snippet from the readme shows one could execute a few tasks asynchronously and wait indefinitely:
doSomething(1)
}.async(.Utility) {
doSomething(2)
}.async(.High) {
doSomethingUrgently(3)
}.wait()
You can find KillerRabbit on Github here.
A nice library with a great syntax for working with GCD.
Original article: Open Source Swift Library Providing A Nice Concise Syntax For Working With GCD
©2015 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.