Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A block-based API for NSValueTransformer, with a growing collection of useful examples.
Objective-C Ruby
Branch: master
Pull request Compare This branch is 4 commits ahead, 54 commits behind mattt:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


A block-based API for NSValueTransformer, with a growing collection of useful examples.

NSValueTransformer, while perhaps obscure to most iOS programmers, remains a staple of OS X development. Before Objective-C APIs got in the habit of flinging block parameters hither and thither with reckless abandon, NSValueTransformer was the go-to way to encapsulate mutation functionality--especially when it came to Bindings.

NSValueTransformer is convenient to use, but a pain to set up. Creating even a trivial value transformer required creating of its own subclass, implementing the handful of required methods, and registering a singleton instance by name.

TransformerKit breathes new life into NSValueTransformer, by making them dead-simple to define and register:

NSString * const TTTCapitalizedStringTransformerName = @"TTTCapitalizedStringTransformerName";

[NSValueTransformer registerValueTransformerWithName:TTTCapitalizedStringTransformerName
                               transformedValueClass:[NSString class]
                  returningTransformedValueWithBlock:^id(id value) {
  return [value capitalizedString];

TransformerKit pairs nicely with InflectorKit & FormatterKit, providing well-designed APIs for manipulating user-facing content.

TransformerKit also contains a growing number of convenient transformers that your apps will love and cherish:

String Transformers

  • Capitalized
  • lowercase
  • CamelCase
  • llamaCase
  • snake_case
  • train-case
  • esreveR* (Reverse)
  • Rémövê Dîaçritics (Remove accents and combining marks)
  • ट्रांस्लितेराते स्ट्रिंग (Transliterate to Latin)

Image Transformers

  • PNG Representation*
  • JPEG Representation*

* - Reversible


Mattt Thompson


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

Something went wrong with that request. Please try again.