I have a Core Data model defined with two attributes
- (Double) latitude
- (Double) longitude
Now, I would like to fetched these objects and sort them depending on how far they are compared to the user’s current location. I already know how to get the current location, but what I still can’t figure out is how to sort the results depending on two attributes.
I’ve searched for something similar but I’m still a bit confused.
That’d be great if someone could point me to the right direction.
Thanks
Sorting with a comparator block is quite easy
As I just learned from lnafziger, you should add that useful hack/workaround¹, he is showing, to this.
¹choose form this words the one, that has the most positive connotation for you