I'm using dispatch_async to run a section of code (a specific method) on a parallel queue (a series of connectivity checks, not really important)
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self connectivityChecks];
});
Everything is working fine with this while on the current view controller.
What I would like to do (if possible) is to load a new view controller modally and keep that section of code running, as it would fire some events on the new view controller based on the checks it's running. Using this to load new view.
CustomViewController *customLoader = [[CustomViewController alloc] init];
[customLoader setModalPresentationStyle:UIModalPresentationFullScreen];
[self presentViewController:customLoader animated:YES completion:nil];
Is it at all possible to have this working this way? If not, how could I achieve something along these lines?
I transform my comment into a more detailed answer :
Insert a method in charge to launch an async task in it
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[self connectivityChecks];
});