TableKit icon indicating copy to clipboard operation
TableKit copied to clipboard

Dynamic cell height based on configured item

Open Wisors opened this issue 8 years ago • 3 comments

Issue: some cell might have different static heights for each state of item. As a result now, I have to create a two copies of cell with different heights, because cell class only has ability to return it height from the static variable. I know I can use AutoLayout, but it actually much slower and I need to improve performance here. I propose to deprecate this static variables:

    static var defaultHeight: CGFloat? { get }
    static var estimatedHeight: CGFloat? { get }

And replace it with instance functions:

    func estimatedHeight(with _: T) -> CGFloat?
    func heigth(with _: T) -> CGFloat?

With this approach it is still possible to return static value, but in the same time much more flexible for user.

Wisors avatar Mar 24 '17 11:03 Wisors

+1

resashkin avatar Mar 05 '18 18:03 resashkin

@maxsokolov Hey! Is it possible to add this feature? Thanks!

Banck avatar Jun 29 '18 03:06 Banck

Hey @Banck I don't have plan for this in the near future.

maxsokolov avatar Jun 29 '18 07:06 maxsokolov