Skip to content

Instantly share code, notes, and snippets.

@kaishin
Last active December 27, 2015 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaishin/7344142 to your computer and use it in GitHub Desktop.
Save kaishin/7344142 to your computer and use it in GitHub Desktop.
My concurrency homie. Sprinkle some of it inside and around your blocks and concurrency will never come back to haunt you again.
NSLog([NSThread currentThread] == [NSThread mainThread] ? @"❇️ Main thread, it is." : @"♒️ Doesn't look like main thread around here...");
func threadCheck() {
println(NSThread.currentThread() == NSThread.mainThread() ? "❇️ Main thread, it is." : "♒️ Doesn't look like main thread around here...")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment