Reputation: 933
I get an error right before ["toPosition"]
saying Ambiguous use of subscript
guard let toLoc = self.currentDetailObj!["toPosition"][0] as? PFGeoPoint else {
return
}
In a previous statement this works fine
guard let fromLoc = self.currentDetailObj!["fromPosition"] as? PFGeoPoint else{
return
}
Why does the first statement not work? I need the position at index 0.
Upvotes: 0
Views: 110
Reputation: 5280
Use .first
guard let toLoc = self.currentDetailObj?["toPosition"].first as? PFGeoPoint else {
return
}
Upvotes: 0