From 240150d8c835455b5b67445f0db590e93f5b56ac Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Wed, 27 Apr 2022 18:48:31 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20::=20Format=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/GradientActivityIndicatorViewModelTestCase.swift | 2 +- .../GradientActivityIndicatorViewModel.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift b/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift index 76a1e2e..f8cab7f 100644 --- a/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift +++ b/Example/ExampleTests/ViewModel/GradientActivityIndicatorViewModelTestCase.swift @@ -150,7 +150,7 @@ final class GradientActivityIndicatorViewModelTestCase: XCTestCase { } // Then - let expectedGradientLayerColors = [UIColor.red, .yellow, .green, .yellow, .red, .yellow, .green].map { $0.cgColor } + let expectedGradientLayerColors = [UIColor.red, .yellow, .green, .yellow, .red, .yellow, .green].map(\.cgColor) XCTAssertEqual(receivedGradientLayerColors, expectedGradientLayerColors) } diff --git a/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorViewModel.swift b/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorViewModel.swift index 8c3706f..4c260cd 100644 --- a/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorViewModel.swift +++ b/GradientLoadingBar/Feature/GradientActivityIndicatorView/GradientActivityIndicatorViewModel.swift @@ -121,7 +121,7 @@ extension Array where Element == UIColor { /// /// func infiniteLayerColors() -> [CGColor] { - let cgColors = map { $0.cgColor } + let cgColors = map(\.cgColor) // Simulate infinite animation - Therefore we'll reverse the colors and remove the first and last item // to prevent duplicate values at the "inner edges" destroying the infinite look.