diff --git a/covid19/CasesWidget/CasesWidget.swift b/covid19/CasesWidget/CasesWidget.swift index 5dd843f..29de167 100644 --- a/covid19/CasesWidget/CasesWidget.swift +++ b/covid19/CasesWidget/CasesWidget.swift @@ -83,7 +83,7 @@ struct SimpleEntry: TimelineEntry { self.casesData = casesArray.map { $0/maxCasesScalingValue }.reversed() self.deathsData = deathsArray.map { $0/maxDeathsScalingValue }.reversed() - if let response = response, + if let response, let urlReponse = response as? HTTPURLResponse, let lastModified = urlReponse.allHeaderFields[Constants.lastModifiedHeaderFieldKey] as? String { lastUpdated = lastModified @@ -179,7 +179,7 @@ struct WidgetView: View { } private func formatCount(val: Int?) -> String { - if let val = val { + if let val { return "\(val.formattedWithSeparator)" } return " " diff --git a/covid19/covid19/ViewModel.swift b/covid19/covid19/ViewModel.swift index e6ddeeb..5135594 100644 --- a/covid19/covid19/ViewModel.swift +++ b/covid19/covid19/ViewModel.swift @@ -143,7 +143,7 @@ final class ViewModel: ObservableObject { } @objc private func updateFooterText() { - if let error = error { + if let error { footerText = error return } diff --git a/covid19/covid19/Views/WebView.swift b/covid19/covid19/Views/WebView.swift index 33b0e91..7624868 100644 --- a/covid19/covid19/Views/WebView.swift +++ b/covid19/covid19/Views/WebView.swift @@ -30,12 +30,12 @@ struct WebView: UIViewRepresentable { } func updateUIView(_ uiView: WKWebView, context: Context) { - guard let url = url else { return } + guard let url else { return } uiView.load(URLRequest(url: url)) } func reloadWebView() { - guard let url = url else { return } + guard let url else { return } webView.load(URLRequest(url: url)) } }