KGNThread 1.0

KGNThread 1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2016
SPMSupports SPM

Maintained by David Keegan.



  • By
  • David Keegan

KGNThread

KGNThread is a collection of helpful methods that wrap Grand Central Dispatch.

Installing

Examples

Each method is called with an optional delay, and a block to execute on the thread.

Main

Dispatch on the main thread, useful for updating the UI from a background thread.

Thread.Main {
    // Do something on the main thread
}

Thread.Main(delay: 2) {
    // Do something on the main thread,
    // after a 2 second delay
}

Disk

Dispatch on a serial queue reserved for disk access.

Thread.Disk {
    // Write to disk...
}

Global

Dispatch on the global threads: high, low, default, background.

Thread.High {
    // Do something high priority
}

Thread.Low(delay: 5) {
    // Do something low priority,
    // after a 5 second delay
}

Progress

  • [X] Badges
  • [X] Tests
  • [X] Travis
  • [X] Carthage
  • [X] CocoaPods
  • [X] Description
  • [X] Documentation