diff --git a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift index 36476a68..bfc47613 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift @@ -20,8 +20,6 @@ open class LoadingSpinner: View { public var speed: Float = 1.5 - public var defaultDimension: CGFloat = 40 - //-------------------------------------------------- // MARK: - Constraints //-------------------------------------------------- @@ -198,7 +196,7 @@ open class LoadingSpinner: View { strokeColor = model.strokeColor.uiColor lineWidth = model.lineWidth - pinWidthAndHeight(diameter: model.diameter ?? defaultDimension) + pinWidthAndHeight(diameter: model.diameter) } open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { diff --git a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinnerModel.swift b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinnerModel.swift index ef299d46..aab510a4 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinnerModel.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinnerModel.swift @@ -18,7 +18,7 @@ open class LoadingSpinnerModel: MoleculeModelProtocol { public static var identifier: String = "loadingSpinner" public var strokeColor = Color(uiColor: .mvmBlack) public var lineWidth: CGFloat = 3 - public var diameter: CGFloat? + public var diameter: CGFloat = 40 //-------------------------------------------------- // MARK: - Keys @@ -40,7 +40,10 @@ open class LoadingSpinnerModel: MoleculeModelProtocol { let typeContainer = try decoder.container(keyedBy: CodingKeys.self) backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor) - diameter = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .diameter) + + if let diameter = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .diameter) { + self.diameter = diameter + } if let strokeColor = try typeContainer.decodeIfPresent(Color.self, forKey: .strokeColor) { self.strokeColor = strokeColor