@HighlyExperienced
You need redesign your code to make it main-thread-safety or you can use this snippet for working with UIKit:
void vkm_sync_main(dispatch_block_t block) {
if (block == nil) return;
if ([NSThread isMainThread]) {
block();
} else {
dispatch_sync(dispatch_get_main_queue(), block);
}
}
@HighlyExperienced
You need redesign your code to make it main-thread-safety or you can use this snippet for working with UIKit:
void vkm_sync_main(dispatch_block_t block) {
if (block == nil) return;
if ([NSThread isMainThread]) {
block();
} else {
dispatch_sync(dispatch_get_main_queue(), block);
}
}