From 4d4b262688847d7c02ce67987df6a0502929be77 Mon Sep 17 00:00:00 2001 From: Peter Larson Date: Mon, 1 Feb 2021 21:06:19 -0600 Subject: [PATCH] Optional TabBarItem Title --- Sources/StatefulTabView/Helpers/Tab.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/StatefulTabView/Helpers/Tab.swift b/Sources/StatefulTabView/Helpers/Tab.swift index 888602c..16c675d 100644 --- a/Sources/StatefulTabView/Helpers/Tab.swift +++ b/Sources/StatefulTabView/Helpers/Tab.swift @@ -35,7 +35,7 @@ public struct Tab { } // MARK: System Image Names - public init(title: String, + public init(title: String? = nil, systemImageName: String, selectedSystemImageName: String? = nil, badgeValue: String? = nil, @@ -44,18 +44,18 @@ public struct Tab { self.badgeValue = badgeValue var selectedImage: UIImage? + if let selectedSystemImageName = selectedSystemImageName { selectedImage = UIImage(systemName: selectedSystemImageName) } - barItem = UITabBarItem(title: title, image: UIImage(systemName: systemImageName), selectedImage: selectedImage) self.view = AnyView(content()) } // MARK: UIImages - public init(title: String, + public init(title: String? = nil, image: UIImage?, selectedImage: UIImage? = nil, badgeValue: String? = nil,