Beautiful, easy attributed strings in Swift
Composable
and produce an attributed string. The upshot of this is that if you have an array of attributed strings, you can call joined(separator:)
on them, supplying a string, attributed string, or other Composable
as the separator, and get an attributed string. (#328 via #329, @ZevEisenberg).emphasis
attribute. The cool thing about emphasis is that it can modify existing fonts, without having to re-specify the font. This means that you can do something like this: StringStyle(.font(.systemFont(ofSize: 17)), .emphasis(.italic))
, and you'll get an italic version of the system font. Or, you can take any style and get the bold and/or italic version of it without knowing what its font is: someExistingStyle.byAdding(.emphasis([.bold, .italic]))
. Check out the example project for a cool use case for this in XML parsing! (@ZevEisenberg, #303 via #325)Tracking
's kerning(for:)
method public. (@acacuce, #324)swift_version
in podspec for compatibility with CocoaPods 1.4.0.BonMot 5.0 adds support for Xcode 9 and Swift 4, and drops support for Swift 2.x and 3.x. This means it also requires Xcode 9 and Swift 4. Please don't update if you're still using Xcode 8! In Xcode 9, even if your project is all on Swift 3.2, you can build BonMot using Swift 4, as long as you're using CocoaPods 1.4.0+.
We also snuck in a feature and two bug fixes.
NSAttributedStringKey.kern
from the last character, unless it's being concatenated into a large string. https://github.com/Raizlabs/BonMot/pull/290 (Reason)Thanks to @Imperiopolis and @joe-goullaud for their help with this release.