diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift index 2eefd716..3f3792d3 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -123,6 +123,7 @@ open class BarsIndicatorView: CarouselIndicator { bottomAnchor.constraint(equalTo: stackView.bottomAnchor), trailingAnchor.constraint(equalTo: stackView.trailingAnchor) ]) + bounds = CGRectMake(0, 0, 100, Padding.One) } //-------------------------------------------------- @@ -262,17 +263,12 @@ open class BarsIndicatorView: CarouselIndicator { refreshAccessibilityLabels() } - let expression = { [self] in - barReferences[previousIndex].backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor - barReferences[previousIndex].constraint?.constant = IndicatorBar.unselectedHeight - barReferences[previousIndex].layer.cornerRadius = IndicatorBar.unselectedCornerRadius - barReferences[newIndex].backgroundColor = isEnabled ? currentIndicatorColor : disabledIndicatorColor - barReferences[newIndex].constraint?.constant = IndicatorBar.selectedHeight - barReferences[newIndex].layer.cornerRadius = IndicatorBar.selectedCornerRadius - layoutIfNeeded() - } - - // Perform the animation. - isAnimated ? UIView.animate(withDuration: 0.25) { expression() } : expression() + barReferences[previousIndex].backgroundColor = isEnabled ? indicatorColor : disabledIndicatorColor + barReferences[previousIndex].constraint?.constant = IndicatorBar.unselectedHeight + barReferences[previousIndex].layer.cornerRadius = IndicatorBar.unselectedCornerRadius + barReferences[newIndex].backgroundColor = isEnabled ? currentIndicatorColor : disabledIndicatorColor + barReferences[newIndex].constraint?.constant = IndicatorBar.selectedHeight + barReferences[newIndex].layer.cornerRadius = IndicatorBar.selectedCornerRadius + layoutIfNeeded() } } diff --git a/MVMCoreUI/BaseControllers/ViewController.swift b/MVMCoreUI/BaseControllers/ViewController.swift index d2638243..d1df5e13 100644 --- a/MVMCoreUI/BaseControllers/ViewController.swift +++ b/MVMCoreUI/BaseControllers/ViewController.swift @@ -264,7 +264,7 @@ import MVMCore self.pageModel = newPageModel // Run through the differences between separate page model trees. - var pageUpdatedModels = [MoleculeModelProtocol]() + //var pageUpdatedModels = [MoleculeModelProtocol]() if let originalModel, // We had a prior. let newPageModel = newPageModel as? TemplateModelProtocol, originalModel.id != newPageModel.id { @@ -279,17 +279,13 @@ import MVMCore // Notify the manager of new data. // Warning: Some flows cause table reloads. Until the UI update is decoupled, should be after the updateUI. manager?.newDataReceived?(in: self) - - // Dispatch to decouple execution. First massage data through template classes, then render. - Task { @MainActor in - - if allUpdatedMolecules.isEmpty || isFirstRender { - debugLog("Performing full page render...") - updateUI() - } else { - debugLog("Performing partial render of \(allUpdatedMolecules) molecules...") - updateUI(for: allUpdatedMolecules) - } + + if allUpdatedMolecules.isEmpty || isFirstRender { + debugLog("Performing full page render...") + updateUI() + } else { + debugLog("Performing partial render of \(allUpdatedMolecules) molecules...") + updateUI(for: allUpdatedMolecules) } }