From c32e45d0bb85ffb9b9860f0daed99517022d3b73 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 21 Aug 2023 17:50:35 -0500 Subject: [PATCH] updated table Signed-off-by: Matt Bruce --- .../ViewControllers/TableViewTestController.swift | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 }