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

Nested expandable cells supported? #41

Open
hamzabinamin opened this issue Jun 10, 2018 · 4 comments
Open

Nested expandable cells supported? #41

hamzabinamin opened this issue Jun 10, 2018 · 4 comments

Comments

@hamzabinamin
Copy link

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

@hemangshah
Copy link
Contributor

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

@hamzabinamin
Copy link
Author

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

@tsucres
Copy link

tsucres commented Jul 6, 2018

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

@negry
Copy link

negry commented Feb 8, 2021

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

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

4 participants