corrections made

This commit is contained in:
Kevin G Christiano 2020-05-27 09:56:22 -04:00
parent 3ab8969b1b
commit e020a39574
3 changed files with 7 additions and 13 deletions

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}
}