diff --git a/Blockzilla/SettingsViewController.swift b/Blockzilla/SettingsViewController.swift index 0bffa229c1..8111336317 100644 --- a/Blockzilla/SettingsViewController.swift +++ b/Blockzilla/SettingsViewController.swift @@ -115,13 +115,24 @@ class SettingsTableViewToggleCell: SettingsTableViewCell { newLabel.numberOfLines = 0 newLabel.text = toggle.label + + setupDynamicFont() + + if #available(iOS 10.0, *) { + newLabel.adjustsFontForContentSizeCategory = true + newDetailLabel.adjustsFontForContentSizeCategory = true + } else { + NotificationCenter.default.addObserver(forName: UIContentSizeCategory.didChangeNotification, object: nil, queue: nil) { _ in + self.setupDynamicFont() + } + } + textLabel?.numberOfLines = 0 textLabel?.text = toggle.label newDetailLabel.numberOfLines = 0 - newDetailLabel.text = toggle.subtitle detailTextLabel?.numberOfLines = 0 - detailTextLabel?.text = nil + detailTextLabel?.text = toggle.subtitle backgroundColor = UIConstants.colors.cellBackground newLabel.textColor = UIConstants.colors.settingsTextLabel @@ -185,6 +196,11 @@ class SettingsTableViewToggleCell: SettingsTableViewCell { } } + private func setupDynamicFont() { + newLabel.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.body) + newDetailLabel.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.body) + } + private func tappedFooter(topic: String) { guard let url = SupportUtils.URLForTopic(topic: topic) else { return } let contentViewController = SettingsContentViewController(url: url)