Force the progress view label to update with content size changes. Issue #1645
This commit is contained in:
parent
a4896958c3
commit
2e583ae7b2
|
@ -17,6 +17,7 @@ class RefreshProgressView: UIView {
|
|||
|
||||
override func awakeFromNib() {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(progressDidChange(_:)), name: .AccountRefreshProgressDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange(_:)), name: UIContentSizeCategory.didChangeNotification, object: nil)
|
||||
|
||||
if !AccountManager.shared.combinedRefreshProgress.isComplete {
|
||||
progressChanged()
|
||||
|
@ -53,6 +54,12 @@ class RefreshProgressView: UIView {
|
|||
progressChanged()
|
||||
}
|
||||
|
||||
@objc func contentSizeCategoryDidChange(_ note: Notification) {
|
||||
// This hack is probably necessary because custom views in the toolbar don't get
|
||||
// notifications that the content size changed.
|
||||
label.font = UIFont.preferredFont(forTextStyle: .footnote)
|
||||
}
|
||||
|
||||
deinit {
|
||||
NotificationCenter.default.removeObserver(self)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue