Created
February 15, 2016 09:11
-
-
Save serhatsezer/1c0caf4d9a8657376dd5 to your computer and use it in GitHub Desktop.
mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Interface file (.h) | |
| @interface SampleModel | |
| @property(nonatomic, strong) NSString *Title; | |
| @property(nonatomic, strong) NSString *Description; | |
| @end | |
| // Implementation file (.m) | |
| @interface SampleModel | |
| @property(nonatomic, copy) NSString *customProperty; // Framework maps this property too | |
| @end | |
| @implementation SampleModel | |
| + (JSONKeyMapper *)keyMapper { | |
| return [[JSONKeyMapper alloc] initWithDictionary:[self mapping]]; | |
| } | |
| + (NSDictionary *)mapping { | |
| return @ | |
| {@"tt":@"Title", | |
| @"dsc":@"Description"} | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment