This commit is contained in:
Pfeil, Scott Robert 2021-07-16 17:59:19 -04:00
parent 52a872f95d
commit b75f25764f
2 changed files with 2 additions and 11 deletions

View File

@ -17,7 +17,7 @@ public class CornerLabelsModel: ParentMoleculeModelProtocol {
public var bottomRightLabel: LabelModel?
public var molecule: MoleculeModelProtocol?
public var children: [MoleculeModelProtocol] {
return [topLeftLabel, topRightLabel, bottomLeftLabel, bottomRightLabel].compactMap { (molecule: MoleculeModelProtocol?) in molecule }
[molecule, topLeftLabel, topRightLabel, bottomLeftLabel, bottomRightLabel].compactMap { $0 }
}
init(with molecule: MoleculeModelProtocol?) {

View File

@ -94,16 +94,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
extension NavigationItemModel: ParentMoleculeModelProtocol {
public var children: [MoleculeModelProtocol] {
var children: [MoleculeModelProtocol] = []
if let line = line {
children.append(line)
}
if let titleView = titleView {
children.append(titleView)
}
if let backButton = backButton {
children.append(backButton)
}
var children: [MoleculeModelProtocol] = [line, titleView, backButton].compactMap { $0 }
if let leftButtons = additionalLeftButtons {
children.append(contentsOf: leftButtons)
}