Latest 1.1.0
Homepage https://github.com/mattt/TransformerKit
License MIT
Platforms ios 5.0, osx 10.7, requires ARC
Authors

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.
To create a value transformer you have to
create a subclass,
implement a handful of required methods,
and register 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 and
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
  • UPPERCASE
  • lowercase
  • CamelCase
  • llamaCase
  • snake_case
  • train-case
  • esreveR* (Reverse)
  • Rémövê Dîaçritics (Remove accents and combining marks)
  • ट्रांस्लितेराते स्ट्रिंग (Transliterate to Latin)
  • Any Valid ICU Transform*

Image Transformers

  • PNG Representation*
  • JPEG Representation*
  • GIF Representation (macOS)
  • TIFF Representation (macOS)

Date Transformers

JSON Data Transformers

  • JSON Transformer*

Data Transformers (macOS)

  • Base16 String Encode / Decode
  • Base32 String Encode / Decode
  • Base64 String Encode / Decode
  • Base85 String Encode / Decode

Cryptographic Transformers (macOS)

  • MD5, SHA-1, SHA-256, et al. Digests

* – Reversible

Contact

Mattt (@mattt)

License

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

Latest podspec

{
    "name": "TransformerKit",
    "version": "1.1.0",
    "license": "MIT",
    "summary": "A block-based API for NSValueTransformer, with a growing collection of useful examples.",
    "homepage": "https://github.com/mattt/TransformerKit",
    "authors": {
        "Mattt": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mattt/TransformerKit.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "5.0",
        "osx": "10.7"
    },
    "requires_arc": true,
    "subspecs": [
        {
            "name": "Core",
            "source_files": [
                "Sources/NSValueTransformer+TransformerKit.{h,m}",
                "Sources/NSValueTransformerName.h"
            ]
        },
        {
            "name": "Cryptography",
            "dependencies": {
                "TransformerKit/Core": []
            },
            "osx": {
                "source_files": "Sources/TTTCryptographyTransformers.{h,m}",
                "frameworks": "Security"
            }
        },
        {
            "name": "Data",
            "dependencies": {
                "TransformerKit/Core": []
            },
            "osx": {
                "source_files": "Sources/TTTDataTransformers.{h,m}",
                "frameworks": "Security"
            }
        },
        {
            "name": "Date",
            "dependencies": {
                "TransformerKit/Core": []
            },
            "source_files": "Sources/TTTDateTransformers.{h,m}"
        },
        {
            "name": "JSON",
            "dependencies": {
                "TransformerKit/Core": []
            },
            "source_files": "Sources/TTTJSONTransformer.{h,m}"
        },
        {
            "name": "Image",
            "dependencies": {
                "TransformerKit/Core": []
            },
            "source_files": "Sources/TTTImageTransformers.{h,m}"
        },
        {
            "name": "String",
            "dependencies": {
                "TransformerKit/Core": []
            },
            "source_files": "Sources/TTTStringTransformers.{h,m}"
        }
    ]
}

Pin It on Pinterest

Share This