BonMot is an open source library from Raizlabs for working with attributed strings making it easy to utilize advanced typography with your attributed strings.
BonMot provides a clean, chainable syntax for working with advanced text features including, fonts, coloring, alignment, text formatting, inline images, and more.
This snippet from the readme shows how one could format text using BonMot:
"I realized what I loved more was having friends.\n" +
"-Mara Wilson"
// line-wrapped for readability
let attributedString = BONChain()
.lineHeightMultiple(1.2)
.fontNameAndSize("AmericanTypewriter", 17.0)
.string(quote)
.attributedString // You can also query .attributes
// and get back a dictionary of attributes
You can find BonMot on Github here.
A great library for easy text formatting.
Original article: BonMot – Open Source Library Providing Easy Advanced Text Formatting For Attributed Strings
©2016 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.