Tableview and collection view optimizations

This commit is contained in:
Scott Pfeil 2024-06-04 10:48:47 -04:00
parent 25b7af0a07
commit df02a46c62
2 changed files with 4 additions and 2 deletions

View File

@ -177,6 +177,7 @@ open class Carousel: View {
if let originalModel, carouselModel.isDeeplyVisuallyEquivalent(to: originalModel) {
// Prevents a carousel reset while still updating the cell backing data through reconfigureItems.
MVMCoreLoggingHandler.shared()?.handleDebugMessage("[\(Self.self)] Model is visually equivalent. Skipping rebuild...")
prepareMolecules(with: carouselModel)
FormValidator.setupValidation(for: carouselModel, delegate: delegateObject?.formHolderDelegate)
updateModelIndex() // Ensure the new model indexing matches the old.
pagingView?.currentIndex = pageIndex // Trigger a paging view render.

View File

@ -56,13 +56,14 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController, Rotor
}
open override func updateUI(for molecules: [MoleculeModelProtocol]? = nil) {
let isFirstRender = self.isFirstRender
super.updateUI(for: molecules)
guard molecules == nil else { return }
createViewForTableHeader()
createViewForTableFooter()
tableView?.reloadData()
// Reloading the table is handled in updateViews.
}
override open func viewDidLoad() {