     }
     
     return cancelableBlock
-}
-
-func dispatchCancelableBlockAfterDelay(delay: Double, block: dispatch_block_t) -> CancelableDispatchBlock? {
-    
-    return dispatchCancelableBlockAtDate(NSDate(timeIntervalSinceNow: delay), block)
 }
 
 func cancelBlock(block: CancelableDispatchBlock?) {

    
    cancelableBlock = delayBlock
    
//    let interval = date.timeIntervalSince1970
//    var time = timespecFromInterval(interval)
//    
//    dispatch_after(dispatch_walltime(&time, 0), dispatch_get_main_queue()) {

    let interval = Int64(date.timeIntervalSinceNow)
    let delay = interval * Int64(NSEC_PER_SEC)


import Foundation

typealias CancelableDispatchBlock = (cancel: Bool) -> Void

func dispatchCancelableBlockAtDate(date: NSDate, block: dispatch_block_t) -> CancelableDispatchBlock? {
    
