diff --git a/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift b/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift index 4737c2db..941e9b3e 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/TileContainer.swift @@ -97,6 +97,16 @@ open class TileContainer: VDS.TileContainer, VDSMoleculeViewProtocol{ public static func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? { 100 } + + /// Allows the molecule to set its name for reuse. Default could be moleculeName. Mainly used for list or collections. + public static func nameForReuse(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> String? { + // This will aggregate names of molecules to make an id. + guard let model = model as? ButtonGroupModel else { + return "tileContainer<>" + } + return "tileContainer<\(model.moleculeName)>" + } + //-------------------------------------------------- // MARK: - Overrides