Can anyone let me know what i can do here to return a 2D array? From this below i get: Consecutive declarations on a line must be separated by ‘;’ Thank you
func findLocationsForEachRange() -> [[Double]] {
//var myCount = myLocations.count
var locationsVisitedLatLong: [[Double]] = []
for myLocation in myLocations {
if (myLocation.date! >= WeeklySpan(increment: myValue)) {
locationsVisitedLatLong.append(contentsOf: [[myLocation.latitude, myLocation.longitude]])
}
}
}return locationsVistedLatLong[[Double]]
However, a small tip, I don’t know the reason for you using this particular structure, lat lon generally come in pairs, so instead if you use a tuple or a struct, you can have a simple array of lat/longs and manage them easier.