I am using Realm List/Results as my data source for a UITableView . At some point, I will assign him a list. as:
var dataSource:List<SomeObject>!
Then I have a filter on this list. If the user has changed the filter dates, I like this:
dataSource = dataSource.filter("FILTER THE DATES",newDates)
But the above line throws an error because the return type filter is a Results object, and aRealmObject.someList is a list.
What is the best way to handle this situation?
- make dataSource as
List and convert Results object to List ? How?? - do dataSource as
Results and convert List to Results ? How?? - Or maybe you have a better way to do this, please share it with me.
Thanks,
source share