Improvements to logging (#457)

* Use `.info` logging in most places.
* Remove old objc logging support.
* Fix table view controller.
* Make sure timeline item content isn't logged.
* Add tests.
This commit is contained in:
Doug
2023-01-17 09:28:01 +00:00
committed by GitHub
parent 4b56e4af73
commit c8937505d7
57 changed files with 542 additions and 275 deletions
@@ -242,8 +242,6 @@ class TimelineTableViewController: UIViewController {
updateTopPadding()
guard snapshot.numberOfItems != previousLayout.numberOfItems else { return }
if previousLayout.isBottomVisible {
scrollToBottom(animated: false)
} else if let pinnedItem = previousLayout.pinnedItem {
@@ -357,15 +355,19 @@ class TimelineTableViewController: UIViewController {
extension TimelineTableViewController: UITableViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
let isAtBottom = isAtBottom()
// Only update the binding on changes to avoid needlessly recomputing the hierarchy when scrolling.
if scrollToBottomButtonVisible != isAtBottom {
// Dispatch to fix runtime warning about making changes during a view update.
DispatchQueue.main.async { self.scrollToBottomButtonVisible = isAtBottom }
}
paginateBackwardsPublisher.send(())
// Dispatch to fix runtime warning about making changes during a view update.
DispatchQueue.main.async { [weak self] in
guard let self else { return }
let isAtBottom = self.isAtBottom()
// Only update the binding on changes to avoid needlessly recomputing the hierarchy when scrolling.
if self.scrollToBottomButtonVisible != isAtBottom {
self.scrollToBottomButtonVisible = isAtBottom
}
}
}
// MARK: ScrollViewAdapter Methods