主線程刷新UI 單例 ...
主線程刷新UI
dispatch_async(dispatch_get_main_queue(), ^{
///
});
單例
static Tools *_sharedManger;
@implementation Tools
+ (SingleTools *)sharedManger{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
if (!_sharedManger) {
_sharedManger = [[Tools alloc]init];
}
});
return _sharedManger;
}
@end