Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save IgorMuzyka/588be13ada2295e4c9853c7e78875462 to your computer and use it in GitHub Desktop.
Save IgorMuzyka/588be13ada2295e4c9853c7e78875462 to your computer and use it in GitHub Desktop.
struct Person: Codable { // your type conforming to Codable
let id: String
let name: String
let age: Int
}
extension Person: RestorablePersistable { // confroming your type to get those convenient methods
static let fileExtension: String = ".person"
var fileName: String { return id }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment