From ac5c65edd0a496b86aaf0b751324626f513a3046 Mon Sep 17 00:00:00 2001 From: "Hedden, Kyle Matthew" Date: Thu, 17 Oct 2024 20:30:56 -0400 Subject: [PATCH] Digital PCT265 story MVAPCT-272: Minor code cleanups. --- MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift b/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift index f0bbcfda..c0cbc1dc 100644 --- a/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift +++ b/MVMCoreUI/Atomic/Templates/MoleculeListTemplate.swift @@ -20,7 +20,7 @@ public struct MoleculeInfo: Hashable, CustomDebugStringConvertible { } public var moleculeId: String - // TODO: This is an existing bug in the template handling. cellReuseId is a deep definition of the cell and its children. Structural changes to the cell should re-register. + // cellReuseId is a deep definition of the cell and its children. Structural changes to the cell should re-register. public let cellReuseId: String public let cellType: MoleculeViewProtocol.Type @@ -335,7 +335,7 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol }) != nil }) - // A full reload can cause a flicker / animation. Better to avoid with above reconfigure method. + // A full reload can cause a flicker / animation in the cell's nested view as its being rebuilt. Better to avoid with reconfigure method which will begin with the original cell state should the cell be on screen and visible. snapshot.reconfigureItems(updatedListItems) dataSource.defaultRowAnimation = .fade @@ -485,8 +485,6 @@ extension MoleculeListTemplate: MoleculeListProtocol { public func swapMolecules(_ molecules: [ListItemModelProtocol & MoleculeModelProtocol], with replacements: [ListItemModelProtocol & MoleculeModelProtocol], position: AddMoleculesPosition, molecule: (ListItemModelProtocol & MoleculeModelProtocol)?, animation: UITableView.RowAnimation?) { - guard let tableView else { return } - var snapshot = dataSource.snapshot() debugLog("[SWAP] State before: \(snapshot.itemIdentifiers)")