From a81ff55e6ecf6a10214143a18a3e7efcbcdca308 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 29 Jan 2024 15:25:34 -0600 Subject: [PATCH 1/3] updated to not return hardcoded value Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift index 04128e90..9f367691 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) { } From 8201b8fad4974c8d1ce64303a8192b053b78ed09 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 29 Jan 2024 15:27:52 -0600 Subject: [PATCH 2/3] fixed bug Signed-off-by: Matt Bruce --- MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift index 9f367691..5b1fbe73 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/LoadingSpinner.swift @@ -30,7 +30,7 @@ open class LoadingSpinner: VDS.Loader, VDSMoleculeViewProtocol { // MARK: - MVMCoreViewProtocol //-------------------------------------------------- open class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { - guard let model = model as? LoadingSpinnerModel else return { 0 } + guard let model = model as? LoadingSpinnerModel else { return 0 } return model.diameter } From ce66b2466ec0debb56c832f6a6037b83028bb561 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Mon, 29 Jan 2024 15:28:02 -0600 Subject: [PATCH 3/3] check to ensure this hasn't been created. Signed-off-by: Matt Bruce --- MVMCoreUI/Legacy/Views/MFLoadingSpinner.m | 1 + 1 file changed, 1 insertion(+) 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];