Я использую KPDDropDownMenu внутри ячейки табличного представления, когда при прокрутке в меню появляются объекты из старой повторно используемой ячейки.
У меня вопрос, как повторно использовать в этой ситуации
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let searchObject = searchObjects[indexPath.section]
let cell = tableView.dequeueReusableCell(withIdentifier: searchObject.viewIdentifier, for: indexPath)
(cell as! CommonSearch).setup(withSearchObject: searchObject)
(cell as? _DropDownTVC)?.dropDownOptions.optionsDidAppearedWithHeightClosure = {
(optionsHeight) in
self.searchObjects[indexPath.section].viewHeight += optionsHeight
tableView.beginUpdates()
tableView.endUpdates()
}
return cell
}
func setup(withSearchObject searchObject: SearchObject) {
searchkeyL.text = searchObject.searchKey
dropDownOptions.items = searchObject.options
}