Setting default status to Tab bar model.

This commit is contained in:
Sumanth Nadigadda 2022-03-29 18:58:15 +05:30
parent cd87a78072
commit 71a9b139d3

View File

@ -52,7 +52,7 @@ open class TabBarModel: MoleculeModelProtocol {
}
}
open var style: NavigationItemStyle?
open var style: NavigationItemStyle? = .dark
// Must be capped to 0...(tabs.count - 1)
open var selectedTab: Int = 0
@ -86,7 +86,9 @@ open class TabBarModel: MoleculeModelProtocol {
if let index = try typeContainer.decodeIfPresent(Int.self, forKey: .selectedTab) {
selectedTab = index
}
style = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style)
if let navStyle = try typeContainer.decodeIfPresent(NavigationItemStyle.self, forKey: .style) {
style = navStyle
}
}
open func encode(to encoder: Encoder) throws {