3lvis / DATASource

Core Data's NSFetchedResultsController wrapper for UITableView and UICollectionView
Other
106 stars 27 forks source link

Support transient property as sectionName #70

Closed zarv1k closed 8 years ago

zarv1k commented 8 years ago

Fix #69

See changeset 7351842 for reproduce the issue, 555678d - fixes the issue. But I suppose the default implementation of UITableViewDataSource.sectionIndexTitlesForTableView(_:) should be like in ea3c945

@3lvis could you please check this out and test with transient and managed properties as well.

zarv1k commented 8 years ago

Found the issue with sort by count within one section with this changes.

3lvis commented 8 years ago

Found the issue with sort by count within one section with this changes.

What do you mean? Could you explain, please?

3lvis commented 8 years ago

This looks good @zarv1k! It's awesome that we can replace all of that code with just self.fetchedResultsController.sectionIndexTitles. 👏

zarv1k commented 8 years ago

What do you mean? Could you explain, please?

https://vimeo.com/167657891 In modified example that I provide in this PR there are two sort descriptors used. And the second one does not applied because the first sort descriptor is by name (not by 'firstLetterOfName' because we can't sort by transient property). This not expected behavior is from SQL 'ORDER BY' nature. I tried to apply custom string function in first descriptor by a part (first letter) of 'name' but no luck, Core Data with SQL storage does not support custom string functions.

3lvis commented 8 years ago

Oh damn! I'll rever this one until we find a solution :)