OCKCareCardViewControllerDelegate Protocol Reference

Conforms to NSObject
Declared in OCKCareCardViewController.h

An object that adopts the OCKCareCardViewControllerDelegate protocol can use it modify or update the events before they are displayed.

– careCardViewController:shouldHandleEventCompletionForActivity:

Asks the delegate if care card view controller should automatically mark the state of an intervention activity when the user selects and deselects the intervention circle button. If this method is not implemented, care card view controller handles all event completion by default.

- (BOOL)careCardViewController:(OCKCareCardViewController *)viewController shouldHandleEventCompletionForActivity:(OCKCarePlanActivity *)interventionActivity

Parameters

viewController

The view controller providing the callback.

interventionActivity

The intervention activity that the user selected.

Discussion

If returned NO, the careCardViewController:didSelectButtonWithInterventionEvent method can be implemeted to provide custom logic for completion.

Declared In

OCKCareCardViewController.h

– careCardViewController:didSelectButtonWithInterventionEvent:

Tells the delegate when the user tapped an intervention event.

- (void)careCardViewController:(OCKCareCardViewController *)viewController didSelectButtonWithInterventionEvent:(OCKCarePlanEvent *)interventionEvent

Parameters

viewController

The view controller providing the callback.

interventionEvent

The intervention event that the user selected.

Discussion

If the user must perform some activity in order to complete the intervention event, then this method can be implemented to show a custom view controller.

If the completion status of the event is dependent on the presented activity, the developer can implement the careCardViewController:shouldHandleEventCompletionForActivity to control the completion status of the event.

Declared In

OCKCareCardViewController.h

– careCardViewController:didSelectRowWithInterventionActivity:

Tells the delegate when the user selected an intervention activity.

- (void)careCardViewController:(OCKCareCardViewController *)viewController didSelectRowWithInterventionActivity:(OCKCarePlanActivity *)interventionActivity

Parameters

viewController

The view controller providing the callback.

interventionActivity

The intervention activity that the user selected.

Discussion

This can be implemented to show a custom detail view controller. If not implemented, a default detail view controller will be presented.

Declared In

OCKCareCardViewController.h

– careCardViewController:willDisplayEvents:dateComponents:

Tells the delegate when a new set of events is fetched from the care plan store.

- (void)careCardViewController:(OCKCareCardViewController *)viewController willDisplayEvents:(NSArray<NSArray<OCKCarePlanEvent*> *> *)events dateComponents:(NSDateComponents *)dateComponents

Parameters

viewController

The view controller providing the callback.

events

An array containing the fetched set of intervention events grouped by activity.

dateComponents

The date components for which the events will be displayed.

Discussion

This is invoked when the date changes or when the care plan store’s carePlanStoreActivityListDidChange delegate method is called. This provides a good opportunity to update the store such as fetching data from HealthKit.

Declared In

OCKCareCardViewController.h