From e020a395745c9662f22dae7b11ca3b609f501f90 Mon Sep 17 00:00:00 2001 From: Kevin G Christiano Date: Wed, 27 May 2020 09:56:22 -0400 Subject: [PATCH] corrections made --- MVMCoreUI/Atomic/Atoms/Views/Arrow.swift | 9 +++------ .../Views/CarouselIndicator/CarouselIndicator.swift | 9 +++------ MVMCoreUI/Atomic/Atoms/Views/LineModel.swift | 2 +- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/Arrow.swift b/MVMCoreUI/Atomic/Atoms/Views/Arrow.swift index 0a3e0457..a437f9d8 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/Arrow.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/Arrow.swift @@ -42,15 +42,12 @@ open class Arrow: View { open var color: UIColor { get { - if let model = arrowModel, model.inverted { - return arrowModel?.color_inverted.uiColor ?? .mvmWhite - } else { - return arrowModel?.color.uiColor ?? .mvmBlack - } + guard let model = arrowModel else { return .mvmBlack } + return model.inverted ? model.color_inverted.uiColor : model.color.uiColor } set { if let model = arrowModel, model.inverted { - arrowModel?.color_inverted = Color(uiColor: newValue) + model.color_inverted = Color(uiColor: newValue) } else { arrowModel?.color = Color(uiColor: newValue) } diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift index e202a212..6bff6e6b 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicator.swift @@ -79,15 +79,12 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol { public var indicatorColor: UIColor { get { - if let model = carouselIndicatorModel, model.inverted { - return carouselIndicatorModel?.indicatorColor_inverted.uiColor ?? .mvmWhite - } else { - return carouselIndicatorModel?.indicatorColor.uiColor ?? .mvmBlack - } + guard let model = carouselIndicatorModel else { return .mvmBlack } + return model.inverted ? model.indicatorColor_inverted.uiColor : model.indicatorColor.uiColor } set { if let model = carouselIndicatorModel, model.inverted { - carouselIndicatorModel?.indicatorColor_inverted = Color(uiColor: newValue) + model.indicatorColor_inverted = Color(uiColor: newValue) } else { carouselIndicatorModel?.indicatorColor = Color(uiColor: newValue) } diff --git a/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift b/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift index 8a245066..3189deab 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LineModel.swift @@ -106,7 +106,6 @@ import UIKit } if let backgroundColor_inverted = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor_inverted) { - self.backgroundColor_inverted = backgroundColor_inverted } @@ -121,6 +120,7 @@ import UIKit try container.encode(inverted, forKey: .inverted) try container.encodeIfPresent(frequency, forKey: .frequency) try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) + try container.encodeIfPresent(backgroundColor_inverted, forKey: .backgroundColor_inverted) try container.encodeIfPresent(useVerticalLine, forKey: .useVerticalLine) } }