Refresh UI (including progress indicator) on Timeline when coming out of suspend.

This commit is contained in:
Maurice Parker 2020-01-06 21:23:39 -07:00
parent 9ba0b37cf9
commit 746d061dcf
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil) 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(displayNameDidChange), name: .DisplayNameDidChange, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(willEnterForeground(_:)), name: UIApplication.willEnterForegroundNotification, object: nil)
// Setup the Search Controller // Setup the Search Controller
searchController.delegate = self searchController.delegate = self
@ -448,6 +449,10 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
} }
} }
@objc func willEnterForeground(_ note: Notification) {
updateUI()
}
@objc func scrollPositionDidChange() { @objc func scrollPositionDidChange() {
coordinator.timelineMiddleIndexPath = tableView.middleVisibleRow() coordinator.timelineMiddleIndexPath = tableView.middleVisibleRow()
} }