style push decode

This commit is contained in:
Scott Pfeil 2022-03-09 12:21:25 -05:00
parent 9f574e854b
commit c4c513250c
3 changed files with 3 additions and 9 deletions

View File

@ -83,9 +83,7 @@ open class TabBarModel: MoleculeModelProtocol {
if let index = try typeContainer.decodeIfPresent(Int.self, forKey: .selectedTab) { if let index = try typeContainer.decodeIfPresent(Int.self, forKey: .selectedTab) {
selectedTab = index selectedTab = index
} }
if let style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) { style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style)
self.style = style
}
} }
open func encode(to encoder: Encoder) throws { open func encode(to encoder: Encoder) throws {

View File

@ -89,9 +89,7 @@ open class TabsModel: MoleculeModelProtocol {
_selectedColor = try typeContainer.decodeIfPresent(Color.self, forKey: .selectedColor) _selectedColor = try typeContainer.decodeIfPresent(Color.self, forKey: .selectedColor)
_unselectedColor = try typeContainer.decodeIfPresent(Color.self, forKey: .unselectedColor) _unselectedColor = try typeContainer.decodeIfPresent(Color.self, forKey: .unselectedColor)
_selectedBarColor = try typeContainer.decodeIfPresent(Color.self, forKey: .selectedBarColor) _selectedBarColor = try typeContainer.decodeIfPresent(Color.self, forKey: .selectedBarColor)
if let style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) { style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style)
self.style = style
}
if let index = try typeContainer.decodeIfPresent(Int.self, forKey: .selectedIndex) { if let index = try typeContainer.decodeIfPresent(Int.self, forKey: .selectedIndex) {
selectedIndex = index selectedIndex = index
} }

View File

@ -109,9 +109,7 @@ open class NavigationItemModel: NavigationItemModelProtocol, MoleculeModelProtoc
additionalLeftButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalLeftButtons) additionalLeftButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalLeftButtons)
additionalRightButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalRightButtons) additionalRightButtons = try typeContainer.decodeModelsIfPresent(codingKey: .additionalRightButtons)
titleView = try typeContainer.decodeModelIfPresent(codingKey: .titleView) titleView = try typeContainer.decodeModelIfPresent(codingKey: .titleView)
if let style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) { style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style)
self.style = style
}
} }
open func encode(to encoder: Encoder) throws { open func encode(to encoder: Encoder) throws {