added praentmoleculemodel protocol
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
980ffaee67
commit
725d80b5ce
@ -9,7 +9,7 @@
|
||||
import Foundation
|
||||
import VDS
|
||||
|
||||
open class TileContainerModel: TileContainerBaseModel<TileContainer.Padding, TileContainer>, MoleculeModelProtocol {
|
||||
open class TileContainerModel: TileContainerBaseModel<TileContainer.Padding, TileContainer>, ParentMoleculeModelProtocol, MoleculeModelProtocol {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Properties
|
||||
@ -19,7 +19,15 @@ open class TileContainerModel: TileContainerBaseModel<TileContainer.Padding, Til
|
||||
public var backgroundColor: Color?
|
||||
|
||||
public var molecule: MoleculeModelProtocol?
|
||||
|
||||
public var children: [any MoleculeModelProtocol] {
|
||||
guard let molecule else { return [] }
|
||||
return [molecule]
|
||||
}
|
||||
|
||||
public func replaceChildMolecule(with molecule: MoleculeModelProtocol) throws -> Bool {
|
||||
return try replaceChildMolecule(at: &self.molecule, with: molecule)
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
case id
|
||||
case moleculeName
|
||||
|
||||
Loading…
Reference in New Issue
Block a user