Skip to content

Commit

Permalink
Optimise Settings screen for dynamic type (openfoodfacts#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigimot22 committed Jul 31, 2021
1 parent 0fdd5d9 commit 967183f
Show file tree
Hide file tree
Showing 2 changed files with 896 additions and 871 deletions.
10 changes: 10 additions & 0 deletions Sources/ViewControllers/Settings/SettingsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ class SettingsTableViewController: UITableViewController, MFMailComposeViewContr

@IBOutlet weak var creditsCell: UITableViewCell!
@IBOutlet weak var contactCell: UITableViewCell!
@IBOutlet weak var bottomLink: UIButton!

var dataManager: DataManagerProtocol!

override func viewDidLoad() {
super.viewDidLoad()
self.title = "settings.tab-bar.item".localized
configureForDynamicType()
}

override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -149,3 +151,11 @@ class SettingsTableViewController: UITableViewController, MFMailComposeViewContr
controller.dismiss(animated: true, completion: nil)
}
}

private extension SettingsTableViewController {
func configureForDynamicType() {
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 200
bottomLink.titleLabel?.adjustsFontForContentSizeCategory = true
}
}
Loading

0 comments on commit 967183f

Please sign in to comment.