             var results = self.localStoreMOC?.executeFetchRequest(fetchRequest, error: error)
             if error == nil && results?.count > 0
             {
-            }
-        }
-        return [AnyObject]()
+                var insertedOrUpdatedManagedObjects = results?.filter({(object)->Bool in
+                    
+                    var managedObject:NSManagedObject = object as! NSManagedObject
+                    if (managedObject.valueForKey(CKSIncrementalStoreLocalStoreChangeTypeAttributeName)) as! NSNumber == NSNumber(short: CKSLocalStoreRecordChangeType.RecordUpdated.rawValue)
+                    {
+                        return true
+                    }
+                    return false
+                })
+                
+                var deletedManagedObjects = results?.filter({(object)->Bool in
+                    
+                    var managedObject:NSManagedObject = object as! NSManagedObject
+                    if (managedObject.valueForKey(CKSIncrementalStoreLocalStoreChangeTypeAttributeName)) as! NSNumber == NSNumber(short: CKSLocalStoreRecordChangeType.RecordDeleted.rawValue)
+                    {
+                        return true
+                    }
+                    return false
+                })
+                
+                var insertedOrUpdatedCKRecords = self.insertedOrUpdatedCKRecords(fromManagedObjects: insertedOrUpdatedManagedObjects!)
+                var deletedCKRecordIDs = self.deletedCKRecordIDs(fromManagedObjects: deletedManagedObjects!)
+                
+                return (insertedOrUpdatedCKRecords,deletedCKRecordIDs)
+                
+            }
+        }
+        
+        return (Array<AnyObject>(),Array<AnyObject>())
+    }
+    func applyLocalChangesToServer()
+    {
+        
     }
     
     func insertedOrUpdatedCKRecords(fromManagedObjects managedObjects:Array<AnyObject>)->Array<AnyObject>

    static let defaultEngine=CKSIncrementalStoreSyncEngine()
    var localStoreMOC:NSManagedObjectContext?
    
    func getLocalChanges()->[AnyObject]
    {
        var entityNames=self.localStoreMOC?.persistentStoreCoordinator?.managedObjectModel.entities.map({(entity)->String in
            

            return ckRecordID
        })
    }
}
class CKSIncrementalStoreSyncPushNotificationHandler
{
