Block execution on main thread
priore Feb 16th, 2016 529 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- static void OnMainThread(dispatch_block_t block)
- if (!block)
- else if ([NSThread isMainThread])
- dispatch_async(dispatch_get_main_queue(), block);
RAW Paste Data