Hi guys,
I hope someone can help me here.
I have a SwiftUI like this:
struct Home: View {
@ObservedResults(RealmPet.self) var pets
var body: some View {
VStack {
ForEach(pets, id: \.id) { pet in
...
Is there any way to get to the wrapper of pet like if it was a @ObservedRealmObject ?
Because I want to be able to do something like:
$pet.name = "newName"
(without needing to manually find the object from the realm first). I have quite a few places where I need to be able to modify values, and would like to keep it compact (like it would be with @ObserveredRealmObject).
I’d love to hear a solution to this.
Thanks in advance!