diff --git a/Sources/StatefulTabView/Helpers/Tab.swift b/Sources/StatefulTabView/Helpers/Tab.swift index 888602c..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, @@ -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,