Created
October 10, 2014 17:20
-
-
Save thiagoramos23/c2d2bcd5f06a22ec29cc to your computer and use it in GitHub Desktop.
Domain JsonModelExample
This file contains 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
// | |
// JSPost.h | |
// JSONModelExample | |
// | |
// Created by Thiago Ramos on 10/9/14. | |
// Copyright (c) 2014 br.com.exemplo.jsonmodel. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import "JSONModel.h" | |
@protocol JSComment @end | |
@interface JSPost : JSONModel | |
@property(nonatomic, strong)NSNumber *id; | |
@property(nonatomic, strong)NSString *title; | |
@property(nonatomic, strong)NSString *content; | |
@property(nonatomic, strong)NSArray<JSComment, Optional> *comments; | |
@end |
This file contains 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
// | |
// JSComment.m | |
// JSONModelExample | |
// | |
// Created by Thiago Ramos on 10/9/14. | |
// Copyright (c) 2014 br.com.exemplo.jsonmodel. All rights reserved. | |
// | |
#import "JSComment.h" | |
@implementation JSComment | |
+ (JSONKeyMapper *)keyMapper | |
{ | |
return [JSONKeyMapper mapperFromUnderscoreCaseToCamelCase]; | |
} | |
@end |
This file contains 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
// | |
// JSPost.h | |
// JSONModelExample | |
// | |
// Created by Thiago Ramos on 10/9/14. | |
// Copyright (c) 2014 br.com.exemplo.jsonmodel. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import "JSONModel.h" | |
@protocol JSComment @end | |
@interface JSPost : JSONModel | |
@property(nonatomic, strong)NSNumber *id; | |
@property(nonatomic, strong)NSString *title; | |
@property(nonatomic, strong)NSString *content; | |
@property(nonatomic, strong)NSArray<JSComment, Optional> *comments; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment