Components Can't Be Delegates Directly Edit on GitHub
TL;DR: You can use
CKComponentDelegateAttribute to configure a delegate for a view to proxy delegate methods back to your component.
Components are short-lived, and their lifecycle is not under your control. Thus they should not be delegates or
An example: imagine you’re showing a
UIAlertView. You might be tempted to make the component the delegate:
But if the component hierarchy is regenerated for any reason, the original component will deallocate and the alert view will be left with no delegate.
CKComponentController. Component controllers are long-lived; they persist and keep track of each updated version of your component. You can learn more about component controllers; here’s an example of their use:
Your other option is to use
CKComponentDelegateAttribute, which will proxy delegate callbacks into the component responder chain.
Then in your component, you can implement the delegate methods