aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-12-10 01:27:53 +0530
committerRoopesh Chander <roop@roopc.net>2018-12-10 01:45:34 +0530
commitaa41bd7d6c14cfb8c8622eeee38b07f14688faa5 (patch)
tree38ac3050503f1c24731451b89ca17202d3776f2f /WireGuard/WireGuard/UI
parentTunnel edit: Dynamic Type support (diff)
downloadwireguard-apple-aa41bd7d6c14cfb8c8622eeee38b07f14688faa5.tar.xz
wireguard-apple-aa41bd7d6c14cfb8c8622eeee38b07f14688faa5.zip
Settings: Dynamic Type support
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI')
-rw-r--r--WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift8
1 files changed, 6 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift b/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
index d9675bb..bbe5d25 100644
--- a/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift
@@ -36,7 +36,8 @@ class SettingsTableViewController: UITableViewController {
self.title = "Settings"
self.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneTapped))
- self.tableView.rowHeight = 44
+ self.tableView.estimatedRowHeight = 44
+ self.tableView.rowHeight = UITableView.automaticDimension
self.tableView.allowsSelection = false
self.tableView.register(TunnelSettingsTableViewKeyValueCell.self, forCellReuseIdentifier: TunnelSettingsTableViewKeyValueCell.id)
@@ -231,11 +232,14 @@ class TunnelSettingsTableViewButtonCell: UITableViewCell {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
button = UIButton(type: .system)
+ button.titleLabel?.font = UIFont.preferredFont(forTextStyle: .body)
+ button.titleLabel?.adjustsFontForContentSizeCategory = true
super.init(style: style, reuseIdentifier: reuseIdentifier)
contentView.addSubview(button)
button.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
- button.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
+ button.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor),
+ contentView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: button.bottomAnchor),
button.centerXAnchor.constraint(equalTo: contentView.centerXAnchor)
])
button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside)