Start a new topic

iOS location query - sorting

Hi there, is there way of sorting the location query by distance? I'm using the query below if this is helpful... thank you



let store = sellerOnlineStore

let query = Query(format: "_geoloc = %@", MKCircle(center: currentLocation, radius: 20))

 

store.find(query) { sellers, error in

... }


Ramesh,


There are 2 ways you can write the location queries, 'MKCircle' and 'MKPolygon'. For more details, please check this link. If this doesn't help, please elaborate your use-case.


Thanks,

Pranav

Hi Pranav Thank you for your reply. I'm using MKCircle. I'm trying to sort the data returned from the query based on distance... So closes to furthest. In Android the return is automatically sorted. In ios the data returned seems random... Is there a way of sorting this? Thanks Ramesh

My site which is about shoes shopping is in development. It is like this Payless shoes coupons through which you can get amazing shoes with greater rates. I am having IOs interface issues, it is not properly showing.

Ramesh,


Check sort modifiers for iOS.


Thanks,

Pranav


1 person likes this
Login or Signup to post a comment