-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to control display order in CareCard/SymptomTracker #51
Comments
A delegate method with sorting capability for |
That would be fine. Ability to suppress/hide activities would be desirable there as well. Perhaps controlled in the delegate by having the delegate method given a param with an array of activity |
@heptal The events displayed on the CareCard/SymptomTracker are stored in an array that is used by the UITableViewDataSource. In #57 I was able to modify the grouping and order of the "events" displayed by adding my own sub-arrays and implemented the necessary delegate methods to display/select the corresponding section headers and cells. No need to modify or duplicate some of the functions of the OCKCarePlanStore and it shall remain the single source of truth. |
Closing due to inactivity. Please feel free to reopen if you would like the conversation to continue. |
It would be nice if there were a straightforward way to control display order in
OCKSymptomTrackerViewController
/OCKSymptomTrackerViewController
.The
:willDisplayEvents:dateComponents:
delegate methods allow changes to the events themselves associated with theOCKCarePlanStore
used in initialization. The displayed data is ultimately populated using that store with[_tableView reloadData]
. The display order is determined by the order in which the activities were added to theOCKCarePlanStore
.Is
OCKCarePlanStore
intended to be the persistent single source of truth for CareKit apps?Ways around this include creating a parallel database that serves as the authoritative data source, and creating and populating new
OCKCarePlanStore
s from that for the view controllers. This works but creates a lot of parallel work and may impact performance. One could also (this is a terrible idea) fetch the activities and their associated events, remove and re-add the activities in the desired order, and reconstruct the events for each activity usingOCKCarePlanStore
API methods.Straightforward solutions may include adding a
displayOrder
field to the CoreData model (seems polluting to the model). Alternatively, theOCKCarePlanStore
could expose its NSManagedObjectContext, allowing the creation of a CoreData hierarchy as described here. This way, a 'parent' store would control the persistence/writes and be the source of truth, and 'child'OCKCarePlanStore
s could be created and populated for the view controllers on-demand, populated with the subsets of relevant data in whatever order. Event changes in the child contexts would be passed to the 'parent' for persistence to disk. Does this seem reasonable?Any suggestions are appreciated.
The text was updated successfully, but these errors were encountered: