updated table
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
7f649ba5e6
commit
c32e45d0bb
@ -174,12 +174,15 @@ public class TableViewTestController: UIViewController, Initable, Surfaceable {
|
|||||||
tableView.separatorStyle = .singleLine
|
tableView.separatorStyle = .singleLine
|
||||||
tableView.delegate = self
|
tableView.delegate = self
|
||||||
tableView.dataSource = self
|
tableView.dataSource = self
|
||||||
|
tableView.reloadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
public func refresh() {
|
public func refresh() {
|
||||||
DispatchQueue.main.async { [self] in
|
DispatchQueue.main.async { [self] in
|
||||||
tableView.beginUpdates()
|
UIView.performWithoutAnimation {
|
||||||
tableView.endUpdates()
|
tableView.beginUpdates()
|
||||||
|
tableView.endUpdates()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,6 +205,13 @@ extension TableViewTestController : UITableViewDelegate, UITableViewDataSource {
|
|||||||
cell.contentView.addSubview(component)
|
cell.contentView.addSubview(component)
|
||||||
sample.pin(edgeInset: .init(top: 16, left: 16, bottom: 16, right: 16))
|
sample.pin(edgeInset: .init(top: 16, left: 16, bottom: 16, right: 16))
|
||||||
cell.backgroundColor = surface.color
|
cell.backgroundColor = surface.color
|
||||||
|
|
||||||
|
if var refreshable = component as? Refreshablable {
|
||||||
|
refreshable.onRefresh = { [weak self] in
|
||||||
|
self?.refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user