Possible to sort iCloud query results on field of referenced record?

Say I have the following:


Record1

title1 : String()

record2 : Reference()- This is a reference to Record 2

record3 : Reference()- This is a reference to Record 3


Record2:

title2 : String()


If I'm doing a search through Record 1 for references to a particular Record 2 (the relationship between the two records is many-to-many) is it possible to sort my results of the query by title2?


I have the following code:


let predicate = NSPredicate(format: "record2 = %@", recordTwo.recordID)

let sort = NSSortDescriptor(key: ***"record2.title2"***, ascending: true) //Not sure what I put in between the " " here. Please help.

let query = CKQuery(recordType: "Record1", predicate: predicate)

query.sortDescriptors = [sort]

Possible to sort iCloud query results on field of referenced record?
 
 
Q