diff --git a/MVMCoreUI.xcodeproj/project.pbxproj b/MVMCoreUI.xcodeproj/project.pbxproj index f3ba25ce..4d2b2bad 100644 --- a/MVMCoreUI.xcodeproj/project.pbxproj +++ b/MVMCoreUI.xcodeproj/project.pbxproj @@ -3625,7 +3625,7 @@ FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../SharedFrameworks"; INFOPLIST_FILE = MVMCoreUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3655,7 +3655,7 @@ FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../SharedFrameworks"; INFOPLIST_FILE = MVMCoreUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift index f84bdfc5..6476e8fa 100644 --- a/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift +++ b/MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift @@ -176,17 +176,15 @@ open class Carousel: View { MVMCoreLoggingHandler.shared()?.handleDebugMessage("[\(Self.self)] [\(ObjectIdentifier(self).hashValue)]\noriginal model: \(originalModel?.debugDescription ?? "none")\nnew model: \(model)") - if #available(iOS 15.0, *) { - if hasSameCellRegistration(with: carouselModel, delegateObject: delegateObject) { - // 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. - collectionView.reconfigureItems(at: collectionView.indexPathsForVisibleItems) - return - } + guard !hasSameCellRegistration(with: carouselModel, delegateObject: delegateObject) else { + // 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. + collectionView.reconfigureItems(at: collectionView.indexPathsForVisibleItems) + return } MVMCoreLoggingHandler.shared()?.handleDebugMessage("[\(Self.self)] Model is new. Rebuilding carousel.") diff --git a/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift index 3e78dc86..2b78b7cd 100644 --- a/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift @@ -272,13 +272,10 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol debugLog("Refreshing rows \(indexPaths.map { $0.row })") - if #available(iOS 15.0, *) { - // All rows should have been layed out already on the first newDataBuildScreen reload with the getMoleculeInfoList call. Therefore, we can be safe to assume the top level cell configuration will not be modified and only the child content will be updated allowing us to leverage this more efficient method. - tableView.reconfigureRows(at: indexPaths) - } else { - // A full reload can cause a flicker / animation. Better to avoid with above reconfigure method. - tableView.reloadRows(at: indexPaths, with: .automatic) - } + // All rows should have been layed out already on the first newDataBuildScreen reload with the getMoleculeInfoList call. Therefore, we can be safe to assume the top level cell configuration will not be modified and only the child content will be updated allowing us to leverage this more efficient method. + // A full reload can cause a flicker / animation when fetching an entirely new cell. Better to avoid with reconfigure method. + tableView.reconfigureRows(at: indexPaths) + if let selectedIndex = selectedIndex { tableView.selectRow(at: selectedIndex, animated: false, scrollPosition: .none) }