WireGuardApp: Refactor indicator view initialization

Signed-off-by: Andrej Mihajlov <and@mullvad.net>
This commit is contained in:
Andrej Mihajlov 2020-12-14 16:38:16 +01:00 committed by Jason A. Donenfeld
parent 92517bd21e
commit d3400e3a80
1 changed files with 5 additions and 6 deletions

View File

@ -29,15 +29,14 @@ class TunnelListCell: UITableViewCell {
}() }()
let busyIndicator: UIActivityIndicatorView = { let busyIndicator: UIActivityIndicatorView = {
let busyIndicator: UIActivityIndicatorView
if #available(iOS 13.0, *) { if #available(iOS 13.0, *) {
let busyIndicator = UIActivityIndicatorView(style: .medium) busyIndicator = UIActivityIndicatorView(style: .medium)
busyIndicator.hidesWhenStopped = true
return busyIndicator
} else { } else {
let busyIndicator = UIActivityIndicatorView(style: .gray) busyIndicator = UIActivityIndicatorView(style: .gray)
}
busyIndicator.hidesWhenStopped = true busyIndicator.hidesWhenStopped = true
return busyIndicator return busyIndicator
}
}() }()
let statusSwitch = UISwitch() let statusSwitch = UISwitch()