diff --git a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift index 04128e90..5b1fbe73 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift @@ -29,7 +29,10 @@ open class LoadingSpinner: VDS.Loader, VDSMoleculeViewProtocol { //-------------------------------------------------- // MARK: - MVMCoreViewProtocol //-------------------------------------------------- - open class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { 40.0 } + open class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { + guard let model = model as? LoadingSpinnerModel else { return 0 } + return model.diameter + } open func updateView(_ size: CGFloat) { } diff --git a/MVMCoreUI/Legacy/Views/MFLoadingSpinner.m b/MVMCoreUI/Legacy/Views/MFLoadingSpinner.m index 388416e0..11b11d79 100644 --- a/MVMCoreUI/Legacy/Views/MFLoadingSpinner.m +++ b/MVMCoreUI/Legacy/Views/MFLoadingSpinner.m @@ -42,6 +42,7 @@ } -(void) setup { + if (self.loader) { return; } self.loader = [[VDSLoader alloc] init]; [self addSubview: self.loader]; [NSLayoutConstraint pinViewToSuperview:self.loader useMargins:false];