Hello. I`m trying to display modal view on iOS something like this:
-(void) showModal {
…
dispatch_async( dispatch_get_main_queue(), ^{
…
[window makeKeyAndVisible];} );
while( !dataReady_ ) /* Wait till user stops work with modal view*/
{
CFRunLoopRunInMode( kCFRunLoopDefaultMode, 0.2, FALSE );
}
/* Closing modal view and go to exit */
}
It’s worked fine not so long ago on any queue (doesn’t matter main or secondary). But on new devices, iPhone 13 and higher on iOS 16.x it doesn’t works on main queue. View doesn’t not displayed and CFRunLoopRunInMode
always returns 3 (kCFRunLoopRunTimedOut).
On main queue, the modal view isn’t displayed until the showModal
function is complited. But showModal
cannot be complited because the CFRunLoopRunInMode
loop waits until the modal view stop working.
On old devices, iPhone XR on iOS 16.x, it’s still works fine on any queue. It’s seems problem depends of hardware but not depends of operation system version.
Probably I’m do something wrong?
Can I force UI event handler on main queue before completion the showModal
function? On old devices CFRunLoopRunInMode
helps, but now not.