CareKit icon indicating copy to clipboard operation
CareKit copied to clipboard

Access control on Updatable protocols and extensions

Open Neil3079 opened this issue 4 years ago • 2 comments

When creating custom views for daily tasks I am finding myself having to repeat a lot of internal functionality. The reason for this is I try as much as possible to build my views from existing components where possible (as I believe is the intention).

One of the main offenders in this area tends to be functionality relating to the protocols defined in the file CareKit > ViewUpdaters > Updatable.swift and the associated extensions to provide default implementations.

While it is easy enough to copy and paste these into my own project I feel them being internal encourages people to roll their own implementation instead of keeping things consistent which often provides a sub-optimal user experience.

I appreciate API stability is key and the implementation of these methods may change, but in this case, I see that as a positive as in most cases we will want these changes to propagate across our custom views to keep them consistent with those packaged in CareKit.

Neil3079 avatar Apr 08 '20 16:04 Neil3079

Could you perhaps provide us with an example of where you're running into these difficulties? That may help us to either address the problem or point you in a different direction!

erik-apple avatar Apr 08 '20 16:04 erik-apple

Sure no problem!

For example, in quite a few of my custom view I use OCKHeaderView as the header. In my custom ViewSynchronizer I will often have to re-implement functionality contained in OCKHeaderView+Updatable.swft for setting the title, calculating user-readable text based on the schedule and setting accessibility labels.

As said it's not a huge issue to reimplement this functionality, but it feels like it leaves more room for a less than consistent user experience, (not to mention developer slip-ups such as forgetting to implement accessibility labels).

Neil3079 avatar Apr 08 '20 16:04 Neil3079