Invoke code from the main queue Mar 24, 2015 • Daniel Vela To invoke some code from the main queue thread in iOS use the following code: dispatch_async(dispatch_get_main_queue(), ^{ /* some code like show an alert view */ });