[F] Fix "Attempt to insert non-property list object"

This commit is contained in:
Hykilpikonna
2021-01-24 20:14:49 -05:00
parent cb7845499d
commit 4be170e203
2 changed files with 15 additions and 2 deletions
+13
View File
@@ -14,6 +14,19 @@ struct Family: Codable
var name: String
var members: String
// And a hidden field: admin pin
/// Save family to local storage
func localSave()
{
localStorage.setValue(JSON.stringify(self)!, forKey: "family")
}
/// Read family object from local storage
static func fromLocal() -> Family?
{
guard let f = localStorage.string(forKey: "family") else { return nil }
return JSON.parse(Family.self, f)
}
}
struct WVM: Codable