Swift Delayer

February 13, 2016 ยท View on GitHub

SwiftDelayer Build Status codecov.io CocoaPods Compatible GitHub license

Swift Delayer

Just a simple wrapper for the GCD delay functionality written in Swift

Installation

Get SwiftDelayer on CocoaPods, just add pod 'SwiftDelayer' to your Podfile and then run pod install

Usage

import SwiftDelayer

Delayer.delayOnMainQueue(seconds: 2.0){
    print("I was delayed for 2 seconds :-)")            
}

You can also delay on a specific Queue

import SwiftDelayer

let backgroundQueue = dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0)

Delayer.delayOnQueue(seconds: 3.0, queue: backgroundQueue){
    print("I was delayed for 3 seconds :-)")            
}

Author

Chris Jimenez - http://chrisjimenez.net, @chrisjimeneznat