-1

In the starting, I am displaying my current location. But after that, I want to update my current location on the basis of lat-long I get from the API.

How can I update the current location based on the lat long?

user28
  • 89
  • 5
Mukie
  • 129
  • 1
  • 2
  • 9

1 Answers1

0

Unfortunately you cannot do it because mapView.userLocation is a get-only property.

e.g.

mapView.userLocation.location = CLLocation(latitude: coordinate.latitude,
                                           longitude: coordinate.longitude)

cause error

Cannot assign to property: 'location' is a get-only property

Kosuke Ogawa
  • 7,383
  • 3
  • 31
  • 52