Trying to add a marker to Google map,but the app is getting crashed at while addMarker()
function call,Exception details are as follows,
Terminating app due to uncaught exception 'GMSThreadException', reason: 'All calls to the Google Maps SDK for iOS must be made from the UI thread'
FYI vwGogleMap is global and in a function I'm trying to plot marker.
func addMarker() -> Void
{
var vwGogleMap : GMSMapView?
var position = CLLocationCoordinate2DMake(17.411647,78.435637)
var marker = GMSMarker(position: position)
marker.title = "Hello World"
marker.map = vwGogleMap
}
Any help would be appreciated,
TIA.