Giter Site home page Giter Site logo

Comments (3)

maxsokolov avatar maxsokolov commented on June 15, 2024

Hey @Sushant40

Sorry for late response. I don't have plans to add method that you have mentioned. But there is an easy way to support them.

final class MyTableDirector: TableDirector {
    
    func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) 
    {
        invoke(action: .custom("my_event"), cell: nil, indexPath: indexPath)
    }
}

and then catch your event with a row action.

from tablekit.

gurgeous avatar gurgeous commented on June 15, 2024

Thanks for creating such a great library, much appreciated!

I am commenting on this ancient issue to leave a hint for anyone else trying to implement this callback. The suggested fix is a difficult one - I don't think you can easily use invoke for willDisplayFooterView because it's a section thing, not a row action. If I'm understanding things correctly, you'd have to create a fake indexPath and add your handler to every row.

You'll have better luck just doing your work directly in a TableDirector subclass, or calling back into some other class via a custom delegate.

from tablekit.

maxsokolov avatar maxsokolov commented on June 15, 2024

Hey @gurgeous, thank you for the comment!

You are right. Suggested solution is not the best one. And agree with you, something like this could work better.

final class MyTableDirector: TableDirector {

    var onWillDisplayFooterView: ((_ section: Int) -> ())?
    
    func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection section: Int) {
        onWillDisplayFooterView?(section)
    }
}

tableDirector.onWillDisplayFooterView = { [weak self] section in
}

from tablekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.