Coder Social home page Coder Social logo

natecook1000 / transformerkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattt/transformerkit

1.0 1.0 0.0 161 KB

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

License: MIT License

Objective-C 92.04% Ruby 2.07% Swift 5.89%

transformerkit's Introduction

TransformerKit

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
  • 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*

Data Transformers

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

Date Transformers

JSON Data Transformers

  • JSON Transformer*

Cryptographic Transformers (OS X)

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

* - Reversible

Contact

Mattt Thompson

License

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

transformerkit's People

Contributors

akashivskyy avatar alltom avatar andygeers avatar carlj avatar codecaffeine avatar d-zhukov avatar dmdeller avatar hankwallace avatar kgn avatar mattt avatar natecook1000 avatar pfandrade avatar robinkunde avatar smic avatar waylonis avatar yas375 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.