diff --git a/VDSSample/ViewControllers/TableViewTestController.swift b/VDSSample/ViewControllers/TableViewTestController.swift index d5bff3a..5c818e0 100644 --- a/VDSSample/ViewControllers/TableViewTestController.swift +++ b/VDSSample/ViewControllers/TableViewTestController.swift @@ -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 }