Skip to content

Modify delegate methods on DataSource? #78

Open

Description

@chrismanderson

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!

Activity

  1. eliperkins commented on Aug 22, 2016

    @eliperkins
    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.

  2. jaredegan commented on Nov 21, 2017

    @jaredegan
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions