I added a Home
concept to my simple test program, which made the chain be Home
has Rooms
which have Items
. But when I tried using something like
let homeID = self.room.home?.id ?? UUID()
_items = Query(#Predicate {
($0.room?.home?.id == homeID) == true
})
it complained about an illegal ternary. Fine, it's picky so I changed the Item
model to have a computed property:
var home: Home? {
return self.room?.home?.id
}
but with that, it crashes at runtime, because it can't find the keypath to .home
.
Is this all expected?