mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-02 10:22:35 +00:00
Empty sizer caches at normal times.
This commit is contained in:
1 parent
4bbe6d3557
commit
4df8d8512c
1 file changed
+15
@@ -645,6 +645,8 @@ private extension MainTimelineModernViewController {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange), name: .DisplayNameDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleLowMemory(_:)), name: .lowMemory, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleAppDidGoToBackground(_:)), name: .appDidGoToBackground, object: nil)
|
||||
}
|
||||
|
||||
private func configureSearchController() {
|
||||
@@ -1048,6 +1050,19 @@ private extension MainTimelineModernViewController {
|
||||
queueUpdateUI()
|
||||
}
|
||||
|
||||
@objc func handleLowMemory(_ note: Notification) {
|
||||
emptyTextSizerCaches()
|
||||
}
|
||||
|
||||
@objc func handleAppDidGoToBackground(_ note: Notification) {
|
||||
emptyTextSizerCaches()
|
||||
}
|
||||
|
||||
func emptyTextSizerCaches() {
|
||||
MultilineUILabelSizer.emptyCache()
|
||||
SingleLineUILabelSizer.emptyCache()
|
||||
}
|
||||
|
||||
@objc func scrollPositionDidChange() {
|
||||
Self.logger.debug("MainTimelineModernViewController: scrollPositionDidChange")
|
||||
timelineMiddleIndexPath = collectionView?.middleVisibleRow()
|
||||
|
||||
Reference in new issue
Block a user