This contains work related to issue #1910
This commit is contained in:
Flowinho 2020-03-15 22:43:46 +01:00
parent 2ade0140bc
commit 47dc34db5d
1 changed files with 2 additions and 2 deletions

View File

@ -17,13 +17,13 @@ extension UITableView {
selectRow(at: indexPath, animated: animations.contains(.select), scrollPosition: .none)
if let visibleIndexPaths = indexPathsForRows(in: safeAreaLayoutGuide.layoutFrame) {
if !(visibleIndexPaths.contains(indexPath) && cellCompletelyVisable(indexPath)) {
if !(visibleIndexPaths.contains(indexPath) && cellCompletelyVisible(indexPath)) {
scrollToRow(at: indexPath, at: .middle, animated: animations.contains(.scroll))
}
}
}
func cellCompletelyVisable(_ indexPath: IndexPath) -> Bool {
func cellCompletelyVisible(_ indexPath: IndexPath) -> Bool {
let rect = rectForRow(at: indexPath)
return safeAreaLayoutGuide.layoutFrame.contains(rect)
}