From 7b9d4cb9e35a88f13face71543ce4773102fe224 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 21 Dec 2018 23:34:56 +0100 Subject: Nuke trailing spaces Signed-off-by: Jason A. Donenfeld --- .../UI/iOS/ViewController/SettingsTableViewController.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'WireGuard/WireGuard/UI/iOS/ViewController/SettingsTableViewController.swift') 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 } -- cgit v1.2.3-59-g8ed1b