Closed zarv1k closed 7 years ago
Hi @zarv1k,
Is this even possible with vanilla NSFetchedResultsController? I can't remember been able to make this work before. Would you mind sharing a sample code to try it out and make sure it also works here?
@3lvis ok, when I have time (probably at evening today) I'll try to modify your TableSwift example for using 'firstLetterOfName' as transient property instead of managed.
Thanks a lot!
Transient property sorting is very important by my mind, for example if you want to group items by month without storing month in database (only NSDate usually stored).
If Core Data has issues with «COUNT» maybe it will be better to specify var in DATASource configuration (e.g.: var supportTransient: Bool
) where we can enable transient support by specifying that after DATASource initialization?
NSFetchedResultsController
supports sectioning by transient properties out of the box without any magic, it is very strange if DATASource won’t have support of that.
@Sorix that could be an option.
I agree with Sorix, I really needed to sort in daily sections, got stuck while trying to make DATASource support it and now will switch back to NSFetchedResultsController for a while :/
The funny thing is, it worked in v. 6.0.0 for sure and it crashes in v. 6.1.1
Cool! Thanks
Doing some spring cleaning, please make a new issue if you still want to do this.
Transient property for sectionName does not supported for now. When I use 'firstLetter' (transient property) as sectionName in DATASource initializer I got error:
'Invalid keypath firstLetter passed to setPropertiesToFetch:'
There is an issue in default implementation of UIDataSourceTableView.sectionIndexTitlesForTableView:. I suppose this method should detect is property transient and should not execute request when property is transient. Or maybe this metnod should notify developer somehow that when using transient property he must implement DATASourceDelegate.sectionIndexTitlesForDataSource: in this case.