Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Difference requiresMainQueueSetup and dispatch_get_main_queue?

$
0
0

I am trying to learn about creating react-native modules for iOS and there is one aspect that came up

Official documentation on threading mentions this block of code alongside its variations

- (dispatch_queue_t)methodQueue{  return dispatch_get_main_queue();}

There is another undocumented peace I saw a lot in the third party libraries which is this

+ (BOOL)requiresMainQueueSetup{    return NO;}

To me, these look kinda similar yet different, hence I wanted to ask for an explanation of following questions

  1. When should dispatch_get_main_queue be added to the module and what happens if it is omitted?

  2. When should requiresMainQueueSetup be added to the module and what happens if it is omitted?

  3. Can dispatch_get_main_queue and requiresMainQueueSetup be used together, if so why and when?

  4. What is the difference between returning YES and NO from requiresMainQueueSetup?


Viewing all articles
Browse latest Browse all 16750

Trending Articles