如何按修改日期对 CloudKit 结果进行排序?

How do I sort CloudKit results by modified date?

我正在尝试按修改日期对搜索结果进行排序。 如果我想按 creationDate 做:

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

修改日期的关键是什么? 所有 NSSortDescriptor 键的列表或找到它们的方法将非常有帮助。

在随机尝试 100 件事情后偶然发现它。 它是:

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

他们的关键是 "modificationDate" 我仍然可以使用这些信息的列表来了解如何找到它们。 -谢谢

您可以在这里简单地查看 Apple 网站上的 CKRecord 密钥(元数据); https://developer.apple.com/reference/cloudkit/ckrecord

这是对你上一个问题的回答。