mirror of
https://github.com/metabolist/metatext
synced 2024-12-27 02:02:38 +01:00
Ensure proper cell layout
This commit is contained in:
parent
9389e1c3b8
commit
ac2d1fb805
@ -803,7 +803,7 @@ private extension TableViewController {
|
||||
self.newItemsViewVisibleConstraint?.isActive = true
|
||||
self.view.layoutIfNeeded()
|
||||
} completion: { _ in
|
||||
self.view.layoutIfNeeded()
|
||||
self.reloadVisibleItems()
|
||||
}
|
||||
}
|
||||
|
||||
@ -814,8 +814,18 @@ private extension TableViewController {
|
||||
self.newItemsViewVisibleConstraint?.isActive = false
|
||||
self.view.layoutIfNeeded()
|
||||
} completion: { _ in
|
||||
self.view.layoutIfNeeded()
|
||||
self.reloadVisibleItems()
|
||||
}
|
||||
}
|
||||
|
||||
func reloadVisibleItems() {
|
||||
guard let visibleItems = tableView.indexPathsForVisibleRows?.compactMap(dataSource.itemIdentifier(for:))
|
||||
else { return }
|
||||
|
||||
var snapshot = dataSource.snapshot()
|
||||
|
||||
snapshot.reloadItems(visibleItems)
|
||||
dataSource.apply(snapshot, animatingDifferences: false)
|
||||
}
|
||||
}
|
||||
// swiftlint:enable file_length
|
||||
|
Loading…
Reference in New Issue
Block a user