UI API called on a background thread

Swift
DispatchQueue.main.async {
    //Do UI Code here. 
    //Call Google maps methods.
}
Source

Also in Swift: