Skip to content

Instantly share code, notes, and snippets.

@matrinox
Created March 27, 2014 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matrinox/9797865 to your computer and use it in GitHub Desktop.
Save matrinox/9797865 to your computer and use it in GitHub Desktop.
NSMutableArray *mapItems = response.mapItems.mutableCopy;
[mapItems sortUsingComparator:^NSComparisonResult(MKMapItem *item1, MKMapItem *item2) {
return [@([item1.placemark.location distanceFromLocation:location]) compare:@([item2.placemark.location distanceFromLocation:location])];
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment