I have the following code and it's working.
if passedValue == "location1" {
var initialLocation = CLLocation(latitude: 48.8618, longitude: 2.1539)
centerMapOnLocation(initialLocation)
loadInitialData()
}
if passedValue == "location2" {
var initialLocation = CLLocation(latitude: 52.2398, longitude: 3.3579)
centerMapOnLocation(initialLocation)
loadInitialData()
}
But to be more concise, i write this , but i ve got the following error message : "Use of unresolved identifier 'initial location'". Any idea ?
if passedValue == "location1" {
var initialLocation = CLLocation(latitude: 48.8618, longitude: 2.1539)
}
if passedValue == "location2" {
var initialLocation = CLLocation(latitude: 52.2398, longitude: 3.3579)
}
centerMapOnLocation(initialLocation)
loadInitialData()