|
|
|
@ -252,18 +252,13 @@ class TimelineTableViewController: DiffableTimelineLikeTableViewController<Timel
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {
|
|
|
|
|
if let item = dataSource.itemIdentifier(for: indexPath),
|
|
|
|
|
case .publicTimelineDescription(local: _) = item {
|
|
|
|
|
// trying to remove cells right in didEndDisplaying crashes in UIKit
|
|
|
|
|
DispatchQueue.main.async {
|
|
|
|
|
self.tableView.contentOffset.y -= cell.bounds.height
|
|
|
|
|
|
|
|
|
|
var snapshot = self.dataSource.snapshot()
|
|
|
|
|
snapshot.deleteItems([item])
|
|
|
|
|
self.dataSource.apply(snapshot) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
override func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
|
|
|
|
|
super.scrollViewWillBeginDragging(scrollView)
|
|
|
|
|
|
|
|
|
|
if isShowingTimelineDescription {
|
|
|
|
|
var snapshot = self.dataSource.snapshot()
|
|
|
|
|
snapshot.deleteSections([.header])
|
|
|
|
|
self.dataSource.apply(snapshot, animatingDifferences: true)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|