Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kgn/kgnthread
A collection of helpful methods that wrap GCD
https://github.com/kgn/kgnthread
Last synced: about 1 month ago
JSON representation
A collection of helpful methods that wrap GCD
- Host: GitHub
- URL: https://github.com/kgn/kgnthread
- Owner: kgn
- License: mit
- Created: 2016-01-25T02:35:00.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-07-06T05:09:00.000Z (over 8 years ago)
- Last Synced: 2024-10-12T12:38:26.089Z (about 1 month ago)
- Language: Swift
- Homepage:
- Size: 19.5 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KGNThread
`KGNThread` is a collection of helpful methods that wrap [Grand Central Dispatch](https://en.wikipedia.org/wiki/Grand_Central_Dispatch).
[![Release](https://img.shields.io/github/release/kgn/KGNThread.svg)](/releases)
[![License](http://img.shields.io/badge/License-MIT-lightgrey.svg)](/LICENSE)[![Build Status](https://travis-ci.org/kgn/KGNThread.svg)](https://travis-ci.org/kgn/KGNThread)
[![Test Coverage](http://img.shields.io/badge/Tests-100%25-green.svg)]()
[![Carthage Compatible](https://img.shields.io/badge/Carthage-Compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods Version](https://img.shields.io/cocoapods/v/KGNThread.svg)](https://cocoapods.org/pods/KGNThread)
[![CocoaPods Platforms](https://img.shields.io/cocoapods/p/KGNThread.svg)](https://cocoapods.org/pods/KGNThread)[![Twitter](https://img.shields.io/badge/[email protected])](http://twitter.com/iamkgn)
[![Follow](https://img.shields.io/github/followers/kgn.svg?style=social&label=Follow%20%40kgn)](https://github.com/kgn)
[![Star](https://img.shields.io/github/stars/kgn/KGNThread.svg?style=social&label=Star)](https://github.com/kgn/KGNThread)## 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.
``` Swift
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.
``` Swift
Thread.Disk {
// Write to disk...
}
```### Global
Dispatch on the global threads: `high`, `low`, `default`, `background`.
``` Swift
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
- [X] AppleTV
- [X] AppleWatch
- [X] Prebuilt Frameworks
- [ ] Travis Test Matrix