ExpandableCell icon indicating copy to clipboard operation
ExpandableCell copied to clipboard

Nested expandable cells supported?

Open hamzabinamin opened this issue 6 years ago • 4 comments

Could you please let me know if this library supports nested expandable cells inside a parent expandable cell?

hamzabinamin avatar Jun 10 '18 14:06 hamzabinamin

The best way to know is by checking it by your self? 👍

hemangshah avatar Jun 11 '18 04:06 hemangshah

I'm kind of stuck, not sure how can I provide a section as a child to a parent section?

hamzabinamin avatar Jun 19 '18 08:06 hamzabinamin

Hi @hamzabinamin, You could check out SwiftyComments. It is focused on collapsible discussion threads, but it might suits your needs :)

tsucres avatar Jul 06 '18 16:07 tsucres

For any who is using this i have the solution.....

1.- Create a custom tableview class like this

import UIKit
import ExpandableCell

class CardManagerTableView: ExpandableTableView {
    
    override var intrinsicContentSize: CGSize {
        self.layoutIfNeeded()
        return self.contentSize
    }

    override var contentSize: CGSize {
        didSet{
            self.invalidateIntrinsicContentSize()
        }
    }

    override func reloadData() {
        super.reloadData()
        self.invalidateIntrinsicContentSize()
    }
        
}

2.- Create your TableViewCell: ExpandedCell {}

3.- In the xib add a tableview and change the class in the Interface builder by the one created at point 1

4.- Add automatic row height for your tableview and then add the delegate methods like you do normally with the expandedDelegate protocol

negry avatar Feb 08 '21 14:02 negry