gbachik
gbachik

Reputation: 1706

How do I sort CloudKit results by modified date?

I'm trying to order search results by the modified date. If I wanted to do by creationDate its:

query.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]

What's the key for modified date? A list of all NSSortDescriptor keys or a way to find them would be extremely helpful.

Upvotes: 5

Views: 2361

Answers (2)

Stuart Cook
Stuart Cook

Reputation: 19

You can simply look at the CKRecord keys (metadata) on the Apple website here; https://developer.apple.com/reference/cloudkit/ckrecord

This is in answer to your last question.

Upvotes: 1

gbachik
gbachik

Reputation: 1706

Found it on accident after randomly trying 100 things. It's:

query.sortDescriptors = [NSSortDescriptor(key: "modificationDate", ascending: false)]

They key being "modificationDate" I could still use a list of these a info on how to find them. -Thanks

Upvotes: 10

Related Questions