Hack around UIKit bug in static tables with dynamic type

This commit is contained in:
Maurice Parker 2019-04-27 17:21:29 -05:00
parent 97c62f7546
commit df43dad23e
1 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,12 @@ class SettingsViewController: UITableViewController {
weak var presentingParentController: UIViewController?
override func viewDidLoad() {
// This hack mostly works around a bug in static tables with dynamic type. See: https://spin.atomicobject.com/2018/10/15/dynamic-type-static-uitableview/
NotificationCenter.default.removeObserver(tableView!, name: UIContentSizeCategory.didChangeNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
@ -88,6 +94,10 @@ class SettingsViewController: UITableViewController {
}
}
@objc func contentSizeCategoryDidChange() {
tableView.reloadData()
}
}
// MARK: OPML Document Picker