I am making an app that uses cloud-kit, and when I ask it to return the data saved on it, its out of order. How to i organize the data by date? And then save it in an array, with array [0] as the most recent data added? by the way, the view controller that saves the data is a different view controller that loads it.
Asked
Active
Viewed 85 times
1 Answers
1
You could ad a sort order to your query like this:
query.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]

Edwin Vermeer
- 13,017
- 2
- 34
- 58