             var recordZoneNotification = CKRecordZoneNotification(fromRemoteNotificationDictionary: userInfo)
             if recordZoneNotification.recordZoneID.zoneName == CKSIncrementalStoreCloudDatabaseCustomZoneName
             {
-                
+                if CKSIncrementalStoreSyncEngine.defaultEngine.performSync()
+                {
+                    print("Performed Sync")
+                }
+                else
+                {
+                    print("Not able to complete sync because of some error")
+                }
             }
             
         }

                
            }
        }
        
        return (insertedOrUpdatedManagedObjects,deletedManagedObjects)
    }
    

            
            for record in ckRecordsWithTypeName.values.array
            {
                print("Got Results to be inserted")
                var managedObject:NSManagedObject = NSEntityDescription.insertNewObjectForEntityForName(type, inManagedObjectContext: self.localStoreMOC!) as! NSManagedObject
                var keys = record.allKeys().filter({(object)->Bool in
                    var key:String = object as! String
                    if record.objectForKey(key) is CKReference
                    {
                        return false
                    }
                    return true
                })
                var values = record.dictionaryWithValuesForKeys(keys)
                print("Values \(values)")
                managedObject.setValuesForKeysWithDictionary(values)
                managedObject.setValue(NSNumber(short: CKSLocalStoreRecordChangeType.RecordNoChange.rawValue), forKey: CKSIncrementalStoreLocalStoreChangeTypeAttributeName)
                managedObject.setValue(record.recordID.recordName, forKey: CKSIncrementalStoreLocalStoreRecordIDAttributeName)
            }
        }
        
        var error:NSError?
        self.localStoreMOC?.save(&error)
        if (error == nil)
        {
            return true
        }
        print("Saving Error \(error!)")
        
        return false
    }
