     
     
     func createMeeting(title: String, date: NSDate, moderatorRecordID: CKRecordID) {
-        //qual o recordID de uma meeting?
-        let recordID = CKRecordID(recordName: String(title))
-        let userRecord = CKRecord(recordType: "Meeting", recordID: recordID)
+        //salvar data no meeting record id desta maneira?
+        let dateFormatter = DateFormatter()
+        dateFormatter.dateFormat = "ddMMyyyy"
+        let dateString = dateFormatter.string(from: date as Date)
+        
+        let recordID = CKRecordID(recordName: String(format: "%@%@%@", title, moderatorRecordID.recordName, dateString))
+        let meetingRecord = CKRecord(recordType: "Meeting", recordID: recordID)
         
         print("Creating meeting \(title)")
         
-        userRecord["title"] = title as NSString
-        userRecord["date"] = date as NSDate
-        userRecord["moderator"] = String(fbID) as NSString
-        
-        
-        ckHandler.saveRecord(record: userRecord)
+        let moderatorReference = CKReference(recordID: moderatorRecordID, action: .none)
+        
+        meetingRecord["title"] = title as NSString
+        meetingRecord["date"] = date as NSDate
+        meetingRecord["moderator"] = moderatorReference
+        
+        
+        ckHandler.saveRecord(record: meetingRecord)
     }
     
     

import CloudKit

class MeetingServices: NSObject, MeetingDelegate {
    
    let ckHandler: CloudKitHandler
    let userServices: UserServices

    
    
    func getUserMeetings(userRecordID: CKRecordID, _ nextMeetings: Bool, completionHandler: @escaping ([CKRecord]?, Error?) -> Void) {
        
        print("Getting user meetings")
        
        let userReference = CKReference(recordID: userRecordID, action: .none)
        let predicate = NSPredicate(format: "user = %@ in participants", userReference) //ATENTION!
        let query = CKQuery(recordType: "Meeting", predicate: predicate)
