#Get current thread Use the below code to check whether the current thread is main thread. NSLog (NSThread.isMainThread() ? "On main thread" : "Not on main thread")