Skip to content

Instantly share code, notes, and snippets.

@lexuanquynh
Created July 15, 2022 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lexuanquynh/9c40d87ba15df812b57a520556d409d2 to your computer and use it in GitHub Desktop.
Save lexuanquynh/9c40d87ba15df812b57a520556d409d2 to your computer and use it in GitHub Desktop.
let data = "{\"name\": \"Tennis ball\"}".data(using: .utf8)!
repository.save(saveClass: DogToy.self, jsonData: data, update: false) { result in
switch result {
case .success:
break
case .failure:
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment