SwipeMenuViewController icon indicating copy to clipboard operation
SwipeMenuViewController copied to clipboard

Update TabView to accept NSAttributedString

Open richard-ash opened this issue 5 years ago • 0 comments

Here I update the TabView to accept NSAttributedString in lieu of String.

This enables quite a bit more flexibility with what you add as the title to the tab bar. For instance, one can now add images using the NSTextAttachment.

Regarding implementation, I have the TabView prefer func tabView(_ tabView: TabView, titleForItemAt index: Int) -> String? over func tabView(_ tabView: TabView, attributedTitleForItemAt index: Int) -> NSAttributedString?, so if you implement both dataSource methods for a given index it will use the original.

richard-ash avatar Nov 19 '20 23:11 richard-ash