aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-12-21 23:34:56 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-12-21 23:34:56 +0100
commit7b9d4cb9e35a88f13face71543ce4773102fe224 (patch)
tree90810e67570a1bd2b520f352b50117925d3b1fab /WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift
parentproviderConfiguration is now a WgQuickConfig (diff)
downloadwireguard-apple-7b9d4cb9e35a88f13face71543ce4773102fe224.tar.xz
wireguard-apple-7b9d4cb9e35a88f13face71543ce4773102fe224.zip
Nuke trailing spaces
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift12
1 files changed, 6 insertions, 6 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift
index 426e053..58f8611 100644
--- a/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift
@@ -58,12 +58,12 @@ class SettingsTableViewController: UITableViewController {
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
guard let logo = tableView.tableFooterView else { return }
-
+
let bottomPadding = max(tableView.layoutMargins.bottom, 10)
let fullHeight = max(tableView.contentSize.height, tableView.bounds.size.height - tableView.layoutMargins.top - bottomPadding)
-
+
let imageAspectRatio = logo.intrinsicContentSize.width / logo.intrinsicContentSize.height
-
+
var height = tableView.estimatedRowHeight * 1.5
var width = height * imageAspectRatio
let maxWidth = view.bounds.size.width - max(tableView.layoutMargins.left + tableView.layoutMargins.right, 20)
@@ -71,11 +71,11 @@ class SettingsTableViewController: UITableViewController {
width = maxWidth
height = width / imageAspectRatio
}
-
+
let needsReload = height != logo.frame.height
-
+
logo.frame = CGRect(x: (view.bounds.size.width - width) / 2, y: fullHeight - height, width: width, height: height)
-
+
if needsReload {
tableView.tableFooterView = logo
}