Comments (5)
Well I think you could achieve this by using the keypath that you want to group by as the sectionNameKeyPath
. However, you would then need to manually handle the section name in the table view itself, by returning the appropriate title in tableView:titleForHeaderInSection:
through a different means since the FRC's titleForHeaderInSection:
will return the values from the other keypath.
from rbqfetchedresultscontroller.
Thank you for your feedback. That is similar to what I am currently doing.
I am not sure this use case is relevant enough to request a feature for this but could you consider it as a future feature? In order have a better performance, using the FRC cache.
from rbqfetchedresultscontroller.
Well I guess my concern is it would potentially complicate the API. You could quickly run into problems if the grouping key path produced sections that didn't match the values for the section name key path.
Which come to think about it, confuses me on why you can't just group on the section key path anyway?
What does your data model look like? If the two key path produce the same logical sectioning of the data, why not just use the key path that also happens to be the section names?
from rbqfetchedresultscontroller.
I'll try to explain,
I am trying to display a contact list. Sectioned from A-Z.
There is a flag in each contact, that if switched, I need to display that contact in the same contact list but in another section for it's letter.
I think that ultimately I need to represent two contact lists. A-Z (with the flag ON) and A-Z (with the flag OFF).
UI-wise on the A-Z list (with the ON flag) I will not display the section titles, hence I set their sectionName to "", and that groups all A-Z(ON) in the same section, which due to other logic on my side is unwanted.
I'm not sure I am making sense.
from rbqfetchedresultscontroller.
I think I understand. Why don't you make a computed property (i.e an ignored property from Realms perspective), that returns the section name:
1, if the flag is YES return the first letter to group it the right section
2. If flag is NO return ""
The FRC can use this computed property to then make sections for "" + A...Z. Those with the switch will be in A...Z and those without will be all together in the separate section.
from rbqfetchedresultscontroller.
Related Issues (20)
- Support transient properties for sectionNameKeyPath HOT 4
- Don't release delegate HOT 5
- Crash on `performFetch` - Index is out of bounds
- Ability to turn off excessive logging for debug builds HOT 3
- When init with a empty realm, the `notificationCollection`'s `notificationBlock` might never got call
- Dead lock when FRC -updateFetchRequest in main thread and -calculateChangesWithAddedSafeObjects in background within same time;
- RBQFetchedRequest support for Properties to Group By
- Swift3 no notification passed to the delegate HOT 1
- RealmSwift 2.1.1 HOT 1
- Reintroduce Git Submodules for RBQSafeRealmObject and RealmUtilities HOT 1
- Crash when deleting sectioned objects.
- Constant crash. HOT 1
- Delegate never released HOT 7
- Update Realm dependency to 2.2
- Sorting with localizedCaseInsensitiveCompare
- SectionNameKeyPath cannot be transient? HOT 1
- Can't support Realm 3.0.0? HOT 6
- can not support Realm (3.7.4)
- Not working with swift 4
- Could you make unregisterChangeNotifications public
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbqfetchedresultscontroller.