From d3400e3a8021ec2d81757f3fb501b18812ba6d49 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Mon, 14 Dec 2020 16:38:16 +0100 Subject: WireGuardApp: Refactor indicator view initialization Signed-off-by: Andrej Mihajlov --- Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift b/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift index 3648fbb..8065f9e 100644 --- a/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift +++ b/Sources/WireGuardApp/UI/iOS/View/TunnelListCell.swift @@ -29,15 +29,14 @@ class TunnelListCell: UITableViewCell { }() 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 }() let statusSwitch = UISwitch() -- cgit v1.2.3-59-g8ed1b