From 71a9b139d3e3486e5867a85d1f7aa5d65e71ec17 Mon Sep 17 00:00:00 2001 From: Sumanth Nadigadda Date: Tue, 29 Mar 2022 18:58:15 +0530 Subject: [PATCH] Setting default status to Tab bar model. --- .../Molecules/HorizontalCombinationViews/TabBarModel.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift index 95e07a34..3b62210c 100644 --- a/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift +++ b/MVMCoreUI/Atomic/Molecules/HorizontalCombinationViews/TabBarModel.swift @@ -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 {