Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Change ProviderDelegate to closure calls #3

Open
GlisboaDev opened this issue Apr 20, 2016 · 4 comments
Open

Change ProviderDelegate to closure calls #3

GlisboaDev opened this issue Apr 20, 2016 · 4 comments

Comments

@GlisboaDev
Copy link

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?

@GabrielCartier
Copy link
Member

GabrielCartier commented Apr 20, 2016

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?

@GlisboaDev
Copy link
Author

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.

@GabrielCartier
Copy link
Member

Agreed. Want to do it?
I can merge it in

@GlisboaDev
Copy link
Author

Yea, sure. I'll do it as soon as I get some time to work on provider

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants