title: Mantle Transform With Nested Dictionaries
body: <p>I thought <a href="https://stackoverflow.com/questions/23268124/transform-nsstring-to-nsurl-within-a-json-array-with-mantle">this</a> question would work for my situation, but my lack of experience with Mantle and iOS in general has dead ended my train of thought.  Basically, I have a big chunk of JSON with nested dictionaries and arrays that I want to convert into Mantle objects.</p>
  
  <pre><code>"features": {
      "App": {
          "status": "_ACTIVE",
          "unavailableReasons": [],
          "modernCapabilities": [{
              "capabilityType": "LOCK_AUTO_REPLY",
              "providerStatuses": [{
                  "providerType": "MY_PROVIDER",
                  "status": false,
                  "unavailableReasons": ["NOT_SUPPORTED_BY_PRODUCT", "DEVICE_OS_NOT_SUPPORTED"]
              }]
          }, 
           ...
           ...             
          {
              "capabilityType": "LOCK_CONTACT_WHITELIST",
              "providerStatuses": [{
                  "providerType": "OTHER_PROVIDER",
                  "status": true,
                  "unavailableReasons": []
              }]
          }
          ]}
   }
  </code></pre>
  
  <p>I want to be able to implement a similar solution to that linked above, namely iterating down the dictionary for the "Features" key, and applying a transform to each key/value pair.  So, in this case, to the "App" key and it's dictionary value (and later, the "modernCapabilities" key and it's array, etc. etc.)  I know that for the later steps I'll need separate model classes, and those exist, but I'm having trouble with the first step, the transform on the "App" key and it's value.</p>
  
  <p>Here's what I have right now:</p>
  
  <pre><code>+ (NSValueTransformer *)featureTypesJSONTransformer {
      NSValueTransformer *transformer = [NSValueTransformer valueTransformerForName:@"FeatureStatus"];
  
      return [MTLValueTransformer transformerWithBlock:^NSDictionary *(NSDictionary *features) {
          NSMutableDictionary *transformedValues = [[NSMutableDictionary alloc] init];
          for (NSString *key in features) {
              id transformedValue = [transformer transformedValue:[features objectForKey:key]];
              if (transformedValue ) {
                  [transformedValues setObject:transformedValue forKey:key];
              }
          }
  
          return transformedValues;
      }];
  }
  </code></pre>
  
  <p>As you can see from the code, I'm trying to preserve the key, and attach it to a new Dictionary with the value being another transform, FeatureStatus in this case (@{ "App" :  })</p>
  
  <p>The problem is that there is no [FeatureStatus transformedValue:], although I do have a JSONKeyPathsForPropetyKey since I want to map the 'status', 'unavailableReasons' and 'modernCapabilities' keys later on.  </p>
  
  <p>What's my next step?  How can I register a ValueTransform that does what I want it to do?</p>