From 761f635e16afacc09f3afc5943ae08689a34b484 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Mon, 14 Dec 2020 16:22:52 +0100 Subject: [PATCH] WireGuardApp: Refactor indicator initialization Signed-off-by: Andrej Mihajlov --- .../TunnelsListTableViewController.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelsListTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelsListTableViewController.swift index 7f405cf..1cf4a07 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelsListTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelsListTableViewController.swift @@ -32,15 +32,14 @@ class TunnelsListTableViewController: UIViewController { }() let busyIndicator: UIActivityIndicatorView = { + let busyIndicator: UIActivityIndicatorView if #available(iOS 13.0, *) { - let busyIndicator = UIActivityIndicatorView(style: .medium) - busyIndicator.hidesWhenStopped = true - return busyIndicator + busyIndicator = UIActivityIndicatorView(style: .medium) } else { - let busyIndicator = UIActivityIndicatorView(style: .gray) - busyIndicator.hidesWhenStopped = true - return busyIndicator + busyIndicator = UIActivityIndicatorView(style: .gray) } + busyIndicator.hidesWhenStopped = true + return busyIndicator }() var detailDisplayedTunnel: TunnelContainer?