Created
April 13, 2018 12:08
-
-
Save TonyNikolov/acb3a20b99186803fbe57240eaf19733 to your computer and use it in GitHub Desktop.
sync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func test() { | |
var human: [String:AnyObject] = [:] | |
human["name"] = "Gosho" as? AnyObject | |
human["id"] = 1 as? AnyObject | |
var pet: [String:AnyObject] = [:] | |
pet["name"] = "Zubi" as? AnyObject | |
pet["id"] = 1 as? AnyObject | |
var pet2: [String:AnyObject] = [:] | |
pet["name"] = "Zubi2" as? AnyObject | |
pet["id"] = 2 as? AnyObject | |
var pet3: [String:AnyObject] = [:] | |
pet["name"] = "Zubi3" as? AnyObject | |
pet["id"] = 3 as? AnyObject | |
human["pets"] = [pet,pet2,pet3] as? AnyObject | |
Sync.changes([human], inEntityNamed: "Human", dataStack: self.dataStack, operations: [.insert, .update]) { (error) in | |
if let error = error { | |
print(error) | |
} | |
if error == nil { | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment