updated table

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-21 17:50:35 -05:00
parent 7f649ba5e6
commit c32e45d0bb

View File

@ -174,12 +174,15 @@ public class TableViewTestController: UIViewController, Initable, Surfaceable {
tableView.separatorStyle = .singleLine
tableView.delegate = self
tableView.dataSource = self
tableView.reloadData()
}
public func refresh() {
DispatchQueue.main.async { [self] in
tableView.beginUpdates()
tableView.endUpdates()
UIView.performWithoutAnimation {
tableView.beginUpdates()
tableView.endUpdates()
}
}
}
}
@ -202,6 +205,13 @@ extension TableViewTestController : UITableViewDelegate, UITableViewDataSource {
cell.contentView.addSubview(component)
sample.pin(edgeInset: .init(top: 16, left: 16, bottom: 16, right: 16))
cell.backgroundColor = surface.color
if var refreshable = component as? Refreshablable {
refreshable.onRefresh = { [weak self] in
self?.refresh()
}
}
return cell
}