From 4d4b262688847d7c02ce67987df6a0502929be77 Mon Sep 17 00:00:00 2001 From: Peter Larson Date: Mon, 1 Feb 2021 21:06:19 -0600 Subject: [PATCH 1/2] 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, From 3d0bae7aede3146235e899acee1be16b93f2a627 Mon Sep 17 00:00:00 2001 From: Peter Larson Date: Mon, 1 Feb 2021 21:10:25 -0600 Subject: [PATCH 2/2] Optional Title --- Sources/StatefulTabView/Helpers/Tab.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/StatefulTabView/Helpers/Tab.swift b/Sources/StatefulTabView/Helpers/Tab.swift index 16c675d..889685e 100644 --- a/Sources/StatefulTabView/Helpers/Tab.swift +++ b/Sources/StatefulTabView/Helpers/Tab.swift @@ -16,7 +16,7 @@ public struct Tab { let badgeValue: String? // MARK: Asset Image Names - public init(title: String, + public init(title: String? = nil, imageName: String, selectedImageName: String? = nil, badgeValue: String? = nil,