Skip to content
This repository was archived by the owner on Dec 16, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Sources/Classes/SwipeMenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public struct SwipeMenuViewOptions {

/// ItemView font. Defaults to `14 pt as bold SystemFont`.
public var font: UIFont = UIFont.boldSystemFont(ofSize: 14)

/// ItemView font kerning. Defaults to `0`
public var kern: CGFloat = 0

/// ItemView clipsToBounds. Defaults to `true`.
public var clipsToBounds: Bool = true
Expand Down
7 changes: 5 additions & 2 deletions Sources/Classes/TabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,11 @@ open class TabView: UIScrollView {
tabItemView.translatesAutoresizingMaskIntoConstraints = false
tabItemView.clipsToBounds = options.clipsToBounds
if let title = dataSource.tabView(self, titleForItemAt: index) {
tabItemView.titleLabel.text = title
tabItemView.titleLabel.font = options.itemView.font
let attributedTitle: NSMutableAttributedString = .init(string: title)
attributedTitle.addAttribute(.font, value: options.itemView.font, range: .init(location: 0, length: title.count))
attributedTitle.addAttribute(.kern, value: options.itemView.kern, range: .init(location: 0, length: title.count))

tabItemView.titleLabel.attributedText = attributedTitle
tabItemView.textColor = options.itemView.textColor
tabItemView.selectedTextColor = options.itemView.selectedTextColor
}
Expand Down