I'm trying to have a list of Strings on RealmSwift
like this:
import Foundation
import RealmSwift
// V1
class foo: Object {
let strings = List<String>()
}
But I get this error:
'List' requires that 'String' inherit from 'Object'
Is anyway to create a list of Strings without creating an entire class with one String property in Realm
?
Arrays of primitives are not yet supported by Realm Swift. You can subscribe to GitHub issue 1120 to be notified when we add support. Until then you'll need to wrap the string in a class that derives from RealmSwift.Object
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With