Unrealm
Unrealm copied to clipboard
Bool can't add to realm
When Bool
default value is 'true', can't save to realm
I changed the demo
struct ToDoItem: Realmable {
var id = UUID().uuidString
var text = ""
var isCompleted = true //modified this default value
static func primaryKey() -> String? {
return "id"
}
}
when I set the 'isCompleted' default value is true. can't save the false to the realm
Can you post an example code, please?
I used your Example
I just modified the
isCompleted
to true
Then run the demo
https://user-images.githubusercontent.com/13991864/138857898-986dc4db-272f-423e-8876-3d5967cad9bf.mov
The isCompleted
can't set to false
You're right. Currently, as a workaround, you can make an init method that takes it as true by default, and leave it false in the definition.
I got here because Realmable
structs are requesting to create an empty init
otherwise they don't comply to Realmable
. What's the cause for the issue explain here (and the init
issue too)? Maybe they're related @arturdev?