ios - put CLLocationCoordinate2D into CLLocation for Swift -


i have method want call when center of map, in cllocationcoordinate2d type.

how put results of cllocationcoordinate2d cllocation?

figured out.

when mapview changes region, lat , lon cllocationcoordinate2d , create cllocation variable lat , lon passed in.

func mapview(mapview: mkmapview!, regiondidchangeanimated animated: bool){      var centre = mapview.centercoordinate cllocationcoordinate2d      var getlat: cllocationdegrees = centre.latitude     var getlon: cllocationdegrees = centre.longitude       var getmovedmapcenter: cllocation =  cllocation(latitude: getlat, longitude: getlon)      self.lastlocation = getmovedmapcenter     self.fetchcafesaroundlocation(getmovedmapcenter)  } 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -