Skip to content

Commit

Permalink
Optional TabBarItem Title
Browse files Browse the repository at this point in the history
  • Loading branch information
p-larson committed Feb 2, 2021
1 parent 81114f7 commit 4d4b262
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/StatefulTabView/Helpers/Tab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public struct Tab {
}

// MARK: System Image Names
public init<T>(title: String,
public init<T>(title: String? = nil,
systemImageName: String,
selectedSystemImageName: String? = nil,
badgeValue: String? = nil,
Expand All @@ -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<T>(title: String,
public init<T>(title: String? = nil,
image: UIImage?,
selectedImage: UIImage? = nil,
badgeValue: String? = nil,
Expand Down

0 comments on commit 4d4b262

Please sign in to comment.