Isn't this the standard "Let the queue pump events" technique for dealing with the async UI elements in iOS that don't always behave like you expect them to - such as the system alerts? I mean, I'm not justifying this code, which looks quite weird, but one of the reasons for it may be that the framework has to allow events to pump through the iOS queues, such that events propagate all the way through to the system alerts ..
Re:React Native Navigation Library
by aaronbrethorst on Tuesday March 14, 2017 @02:59AM
(#13865602)
Weird. Seems like that would be better done by invoking NSRunLoop APIs...Plus, you know, filing a Radar.
Having said that, it kind of feels hacky. I have certainly seen this in various codebases and I can't comment on react native but just with standard iOS programming it often points to a lack of understanding of lifecycle or similar order of when things are happening.