0xjmp / ObjectMapper-Realm

An ObjectMapper extension that serializes arbitrary JSON into Realm's List class
Other
178 stars 43 forks source link

Can't use ListTransform with lists defined with let #13

Closed kashifshaikh closed 7 years ago

kashifshaikh commented 7 years ago

Realm docs say to define list properties with let:

Please see: https://realm.io/docs/swift/latest/#property-attributes

So the ListTransform does not work as it returns a new list and you can't overwrite the list.

0xjmp commented 7 years ago

Using a property defined as let is not the intended use of ListTransform. ObjectMapper fundamentally requires the ability to mutate a property (var).