From 25de79f73d3a642296f70766046ff1792e6d7d38 Mon Sep 17 00:00:00 2001 From: Felix Mau Date: Wed, 9 Mar 2022 21:48:21 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20::=20Move=20custom=20color?= =?UTF-8?q?s=20to=20config=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdvancedExampleViewController.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Example/Example/Scenes/AdvancedExample/AdvancedExampleViewController.swift b/Example/Example/Scenes/AdvancedExample/AdvancedExampleViewController.swift index ac7e284..f2c80bb 100644 --- a/Example/Example/Scenes/AdvancedExample/AdvancedExampleViewController.swift +++ b/Example/Example/Scenes/AdvancedExample/AdvancedExampleViewController.swift @@ -16,6 +16,12 @@ final class AdvancedExampleViewController: UIViewController { private enum Config { /// The programatically applied height of the `GradientActivityIndicatorView`. static let height: CGFloat = 3.5 + + /// The custom gradient colors we use. + /// Source: https://color.adobe.com/Pink-Flamingo-color-theme-10343714/ + static let gradientColors = [ + #colorLiteral(red: 0.9490196078, green: 0.3215686275, blue: 0.431372549, alpha: 1), #colorLiteral(red: 0.9450980392, green: 0.4784313725, blue: 0.5921568627, alpha: 1), #colorLiteral(red: 0.9529411765, green: 0.737254902, blue: 0.7843137255, alpha: 1), #colorLiteral(red: 0.4274509804, green: 0.8666666667, blue: 0.9490196078, alpha: 1), #colorLiteral(red: 0.7568627451, green: 0.9411764706, blue: 0.9568627451, alpha: 1), + ] } // MARK: - Outlets @@ -64,10 +70,7 @@ final class AdvancedExampleViewController: UIViewController { } private func setupCustomColorsGradientLoadingBar() { - // Source: https://color.adobe.com/Pink-Flamingo-color-theme-10343714/ - customColorsGradientLoadingBar.gradientColors = [ - #colorLiteral(red: 0.9490196078, green: 0.3215686275, blue: 0.431372549, alpha: 1), #colorLiteral(red: 0.9450980392, green: 0.4784313725, blue: 0.5921568627, alpha: 1), #colorLiteral(red: 0.9529411765, green: 0.737254902, blue: 0.7843137255, alpha: 1), #colorLiteral(red: 0.4274509804, green: 0.8666666667, blue: 0.9490196078, alpha: 1), #colorLiteral(red: 0.7568627451, green: 0.9411764706, blue: 0.9568627451, alpha: 1), - ] + customColorsGradientLoadingBar.gradientColors = Config.gradientColors } @IBAction private func toggleCustomSuperviewButtonTouchUpInside(_: Any) {