Skip to content

Commit

Permalink
Merge pull request #11 from p-larson/master
Browse files Browse the repository at this point in the history
Make Tab Title Optional
  • Loading branch information
NicholasBellucci authored Feb 2, 2021
2 parents 81114f7 + 3d0bae7 commit 6f24c8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/StatefulTabView/Helpers/Tab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public struct Tab {
let badgeValue: String?

// MARK: Asset Image Names
public init<T>(title: String,
public init<T>(title: String? = nil,
imageName: String,
selectedImageName: String? = nil,
badgeValue: String? = nil,
Expand All @@ -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 6f24c8f

Please sign in to comment.