Skip to content

Instantly share code, notes, and snippets.

@kaishin kaishin/threadCheck.m
Last active Dec 27, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.