younatics / ExpandableCell

✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 5
MIT License
772 stars 124 forks source link

Pushing a UIViewController results in empty cells #70

Open stefanospapa opened 5 years ago

stefanospapa commented 5 years ago

We observed that pushing a UIViewController and returning back the expandedtableview looses cells' contents. We tried this in demo application with the same behaviour

Haykaz-Melikyan commented 5 years ago

1) set tableView.autoReleaseDelegate = false 2) public var expandableDelegate => public weak var expandableDelegate

bebslab commented 5 years ago

Thanks @Haykaz-Melikyan good solution my problem is solved ;-)

KhaliqCitrusbits commented 4 years ago
1. set  tableView.autoReleaseDelegate = false

2. public var expandableDelegate => public weak var expandableDelegate

@Haykaz-Melikyan This will going to solve the actual issue. But using above code makes memory leak in view controller. Deinit is not getting called if we set tableView.autoReleaseDelegate = false.

Setting expandableDelegate in viewWillAppear will solve the issue as well as no memory leak! like this override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) tableview.expandableDelegate = self }