diff --git a/MVMCoreUI/Atomic/Atoms/Views/ArrowModel.swift b/MVMCoreUI/Atomic/Atoms/Views/ArrowModel.swift index 69a6dd1f..61afd465 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/ArrowModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/ArrowModel.swift @@ -60,11 +60,6 @@ open class ArrowModel: MoleculeModelProtocol { required public init(from decoder: Decoder) throws { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) - // if let state = try typeContainer.decodeIfPresent(Bool.self, forKey: .state) { - // self.state = state - // } - // action = try typeContainer.decodeModelIfPresent(codingKey: .action, typeCodingKey: ActionCodingKey.actionType) - // alternateAction = try typeContainer.decodeModelIfPresent(codingKey: .alternateAction, typeCodingKey: ActionCodingKey.actionType) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) disabledColor = try typeContainer.decodeIfPresent(Color.self, forKey: .disabledColor) enabledColor = try typeContainer.decodeIfPresent(Color.self, forKey: .enabledColor) diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift index 0435e84d..d9cfaf50 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -150,7 +150,7 @@ open class BarsIndicatorView: CarouselIndicator { public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) { - guard !barReferences.isEmpty else { + guard !barReferences.isEmpty || totalCount != barReferences.count else { generateBars() return } diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift index 9eac6fd6..38747771 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/CarouselIndicatorModel.swift @@ -15,7 +15,7 @@ open class CarouselIndicatorModel: CarouselPagingModelProtocol, MoleculeModelPro //-------------------------------------------------- public class var identifier: String { - return "barsCarouselIndicator" + return "" } public var backgroundColor: Color? diff --git a/MVMCoreUI/Atomic/Organisms/CarouselModel.swift b/MVMCoreUI/Atomic/Organisms/CarouselModel.swift index 09ab708b..82aee3df 100644 --- a/MVMCoreUI/Atomic/Organisms/CarouselModel.swift +++ b/MVMCoreUI/Atomic/Organisms/CarouselModel.swift @@ -93,14 +93,14 @@ import UIKit public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(moleculeName, forKey: .moleculeName) - try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor) - try container.encodeIfPresent(molecules, forKey: .molecules) - try container.encodeIfPresent(spacing, forKey: .spacing) - try container.encodeIfPresent(border, forKey: .border) - try container.encodeIfPresent(loop, forKey: .loop) - try container.encodeIfPresent(height, forKey: .height) - try container.encodeIfPresent(itemWidthPercent, forKey: .itemWidthPercent) - try container.encodeIfPresent(itemAlignment, forKey: .itemAlignment) + try container.encode(backgroundColor, forKey: .backgroundColor) + try container.encode(molecules, forKey: .molecules) + try container.encode(spacing, forKey: .spacing) + try container.encode(border, forKey: .border) + try container.encode(loop, forKey: .loop) + try container.encode(height, forKey: .height) + try container.encode(itemWidthPercent, forKey: .itemWidthPercent) + try container.encode(itemAlignment, forKey: .itemAlignment) try container.encodeModelIfPresent(pagingMolecule, forKey: .pagingMolecule) } }