How to convert JSON string to MTLModel - Mantle

453 Views Asked by At

Is there any way in mantle to convert a JSON data to MTLModelObject directly, I have gone through the documentation and haven't found a simple way to do so.

It seems there is only support for converting NSDictionary to MTLModelObjects and vice versa.

1

There are 1 best solutions below

0
Yun Zeng On

Mantle can not convert JSON string to model automatically. Override JSONTransformerForKey method and implement ur own NSValueTransformer by using NSJSONSerialization convert JSON String to NSDictionary