Back in the day, we could cast Results
to a List
like this
let realm = try! Realm()
let dogResults = realm.objects(Dog.self)
let dogList = List(dogResults)
Then, SwiftUI brought a naming collision with SwiftUI’s List
so we needed to define which List
it was
let dogList = RealmSwift.List(dogResults)
But, somewhere along the way, that stopped working as well.
let dogList = RealmSwift.List(dogResults)
err: Generic parameter ‘Element’ could not be inferred`
Without iterating, is there another castable/init type solution?
Jay
Oh, and this version throws an error as well
RealmSwift.List(collection: dogResults)
err: Argument type ‘Results’ does not conform to expected type ‘RLMCollection’
Hmmm. Results
is not an RLMCollection?