/StyledString

Easy Attributed Strings in Swift

Primary LanguageSwiftMIT LicenseMIT

StyledString [![CI Status](http://img.shields.io/travis/Sander de Vos/StyledString.svg?style=flat)](https://travis-ci.org/Sander de Vos/StyledString) Version License Platform


Example

let hello = StyledString(string: "Hello")
  .withUnderline()
  .withColor(UIColor.blueColor())
let world = StyledString(string: "world")
  .withStrikethrough()
  .withColor(UIColor.redColor())

label.attributedText = (hello + " " + world)
  .withShadow()
  .withFont(UIFont.boldSystemFontOfSize(50))
  .NSAttributedString()

Result:

Example image

Installation

StyledString is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "StyledString"

Releases

  • 0.3.0 - 2016-03-22 - Swift 2.2 support
  • 0.2.0 - 2015-12-19 - Renamed some with* methods
  • 0.1.0 - 2015-12-02 - Initial public release
  • 0.0.0 - 2015-02-02 - Initial private version for project at Q42

License

StyledString is available under the MIT license. See the LICENSE file for more info.