1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| //
| // MCDefine.h
| // JZGChryslerForPad
| //
| // Created by test on 16/12/6.
| // Copyright © 2016年 Beijing JingZhenGu Information Technology Co.Ltd. All rights reserved.
| //
|
| #ifndef MCDefine_h
| #define MCDefine_h
|
|
| // Use dispatch_main_async_safe instead of dispatch_async(dispatch_get_main_queue(), block)
| #ifndef dispatch_main_async_safe
| #define dispatch_main_async_safe(block)\
| if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(dispatch_get_main_queue())) == 0) {\
| block();\
| } else {\
| dispatch_async(dispatch_get_main_queue(), block);\
| }
| #endif
|
|
|
| #endif /* MCDefine_h */
|
|