Skip to content

Instantly share code, notes, and snippets.

@txaiwieser
Last active January 26, 2019 00:42
Show Gist options
  • Save txaiwieser/54bfa92718881ff335aa to your computer and use it in GitHub Desktop.
Save txaiwieser/54bfa92718881ff335aa to your computer and use it in GitHub Desktop.
Delay.swift
//
// Delay.swift
//
//
// Created by Txai Wieser on 6/11/15.
// Copyright (c) 2015 TDW. All rights reserved.
//
import Foundation
func delay(delay:Double, closure:()->()) {
dispatch_after(
dispatch_time(
DISPATCH_TIME_NOW,
Int64(delay * Double(NSEC_PER_SEC))
),
dispatch_get_main_queue(), closure)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment