Skip to content

Instantly share code, notes, and snippets.

@bobgodwinx
Last active October 26, 2015 14:41
Show Gist options
  • Save bobgodwinx/8725992b369c422b55d3 to your computer and use it in GitHub Desktop.
Save bobgodwinx/8725992b369c422b55d3 to your computer and use it in GitHub Desktop.
/**
Telling the system to dispatch after 2 seconds on the main queue
*/
let dispatchTime = dispatch_time(DISPATCH_TIME_NOW, Int64(2.00 * Double(NSEC_PER_SEC)))
dispatch_after(dispatchTime, dispatch_get_main_queue()) { [weak self] in
guard let strongSelf = self, let aProperty = aProperty else {
return
}
// Do something with aProperty
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment