diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Sources/Classes/SwipeMenuView.swift b/Sources/Classes/SwipeMenuView.swift index cd178ca..bb8a361 100644 --- a/Sources/Classes/SwipeMenuView.swift +++ b/Sources/Classes/SwipeMenuView.swift @@ -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 diff --git a/Sources/Classes/TabView.swift b/Sources/Classes/TabView.swift index c74537a..e28b4bf 100644 --- a/Sources/Classes/TabView.swift +++ b/Sources/Classes/TabView.swift @@ -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 }