Skip to content
/ KGNThread Public

A collection of helpful methods that wrap GCD

License

Notifications You must be signed in to change notification settings

kgn/KGNThread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KGNThread

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

Release License

Build Status Test Coverage Carthage Compatible CocoaPods Version CocoaPods Platforms

Twitter Follow Star

Installing

Carthage

github "kgn/KGNThread"

CocoaPods

pod 'KGNThread'

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

  • Badges
  • Tests
  • Travis
  • Carthage
  • CocoaPods
  • Description
  • Documentation
  • AppleTV
  • AppleWatch
  • Prebuilt Frameworks
  • Travis Test Matrix