Open GlisboaDev opened 8 years ago
I like this. I feel like it can provide a bit more flexibility and we could get rid of the ugly @objc protocol.
The question is, what closure should we allow the cells to have? didSelect, didDeselect? anything else?
I don't think the cells should have these closures. I'd see it as something in the provider. The provider hold the closure reference, its owner set them, and finally the provider DelegateHandler call them as needed. For me makes sense having didSelect and didDeselect as the base ones, since it's what it's mostly used. Other than that, if someone needs to add extra behaviour, the provider can be subclassed and added as necessary.
Agreed. Want to do it? I can merge it in
Yea, sure. I'll do it as soon as I get some time to work on provider
In its current state the provider communicate tableview delegate methods trough ProviderDelegate protocol. The suggestion would be to change this protocol to use closures instead, having a more swift oriented approach. What are your thoughts on it?