Giter Site home page Giter Site logo

Comments (5)

bigfish24 avatar bigfish24 commented on June 23, 2024

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.

beloso avatar beloso commented on June 23, 2024

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.

bigfish24 avatar bigfish24 commented on June 23, 2024

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.

beloso avatar beloso commented on June 23, 2024

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.

bigfish24 avatar bigfish24 commented on June 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.