Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify delegate methods on DataSource? #78

Open
chrismanderson opened this issue Feb 2, 2016 · 2 comments
Open

Modify delegate methods on DataSource? #78

chrismanderson opened this issue Feb 2, 2016 · 2 comments

Comments

@chrismanderson
Copy link
Contributor

Framework is a strong piece of work, thanks for sharing it! One of those things I wish was built into iOS itself.

Have a usage question for you all (that might end up just being a Swift question, but still!) - is there a way to add or modify the UITableViewDelegate methods on DataSource? (https://github.com/venmo/Static/blob/master/Static/DataSource.swift#L260).

For example, I'd like to be able to use tableView:willDisplayHeaderView:forSection:, but I don't see an easy way of hooking into that delegate declared in DataSource.

Tried subclassing DataSource, but then I get the Redudant conformance... error. I could fork the repo, or use a different data source entirely, but those solutions are much 'heavier'; it feels like there must be a better way that I'm missing.

Thanks!

@eliperkins
Copy link
Contributor

I think your second solution, with some mix of composition, would be the best way down this path. Having your data source call into a Static.DataSource for those specific methods would allow you to combine two different functionalities.

However, I think not having access to tableView:willDisplayHeaderView:forSection: is definitely a downer... I'm wondering if there are better solutions here for those desiring that type of functionality.

@jaredegan
Copy link
Contributor

I believe my PR solves this in the best way: #119

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

No branches or pull requests

3 participants