Skip to content

Commit 5afe777

Browse files
committed
Added JSON source view, Moved sample responses to individual JSON files, added description messages.
1 parent 68a6c66 commit 5afe777

File tree

14 files changed

+358
-159
lines changed

14 files changed

+358
-159
lines changed

KVC Validation Pattern/KVC Validation Pattern.xcodeproj/project.pbxproj

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
0331CC1816D2BC340037911A /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 0331CC1716D2BC340037911A /* Default-568h@2x.png */; };
1919
0331CC1B16D2BC340037911A /* CTCViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0331CC1A16D2BC340037911A /* CTCViewController.m */; };
2020
0331CC1E16D2BC340037911A /* CTCViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0331CC1C16D2BC340037911A /* CTCViewController.xib */; };
21+
0331CCC816D3F6820037911A /* ResponseA.json in Resources */ = {isa = PBXBuildFile; fileRef = 0331CCC716D3F6820037911A /* ResponseA.json */; };
22+
0331CCCA16D3F8600037911A /* ResponseB.json in Resources */ = {isa = PBXBuildFile; fileRef = 0331CCC916D3F8600037911A /* ResponseB.json */; };
23+
0331CCCC16D3F87A0037911A /* ResponseC.json in Resources */ = {isa = PBXBuildFile; fileRef = 0331CCCB16D3F87A0037911A /* ResponseC.json */; };
24+
0331CCD016D3F8BB0037911A /* ResponseD.json in Resources */ = {isa = PBXBuildFile; fileRef = 0331CCCF16D3F8BB0037911A /* ResponseD.json */; };
25+
0331CCD216D3F8CB0037911A /* ResponseE.json in Resources */ = {isa = PBXBuildFile; fileRef = 0331CCD116D3F8CA0037911A /* ResponseE.json */; };
2126
D1A960CA1CD295B23407E722 /* CTCFloatTypeValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = D1A960AB8D8D5F2608D1D05C /* CTCFloatTypeValidator.m */; };
2227
D1A9612D29BDD99669FA0318 /* CTCDateTypeValidator.m in Sources */ = {isa = PBXBuildFile; fileRef = D1A96B13B681A0BF8B33277F /* CTCDateTypeValidator.m */; };
2328
D1A961558ADE642EBB7A278D /* CTCStation.m in Sources */ = {isa = PBXBuildFile; fileRef = D1A96109D2CD25E51B9DC18F /* CTCStation.m */; };
@@ -54,6 +59,11 @@
5459
0331CC1916D2BC340037911A /* CTCViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CTCViewController.h; sourceTree = "<group>"; };
5560
0331CC1A16D2BC340037911A /* CTCViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CTCViewController.m; sourceTree = "<group>"; };
5661
0331CC1D16D2BC340037911A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/CTCViewController.xib; sourceTree = "<group>"; };
62+
0331CCC716D3F6820037911A /* ResponseA.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = ResponseA.json; sourceTree = "<group>"; };
63+
0331CCC916D3F8600037911A /* ResponseB.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = ResponseB.json; sourceTree = "<group>"; };
64+
0331CCCB16D3F87A0037911A /* ResponseC.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = ResponseC.json; sourceTree = "<group>"; };
65+
0331CCCF16D3F8BB0037911A /* ResponseD.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = ResponseD.json; sourceTree = "<group>"; };
66+
0331CCD116D3F8CA0037911A /* ResponseE.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = ResponseE.json; sourceTree = "<group>"; };
5767
D1A960242C2D383AC3DEAC1C /* CTCIntegerTypeValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTCIntegerTypeValidator.h; sourceTree = "<group>"; };
5868
D1A9603D974FAEAA5655C472 /* CTCDictionaryTypeValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTCDictionaryTypeValidator.h; sourceTree = "<group>"; };
5969
D1A9608DF3D8068F64698BC3 /* CTCUnsignedIntegerTypeValidator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CTCUnsignedIntegerTypeValidator.h; sourceTree = "<group>"; };
@@ -140,8 +150,13 @@
140150
0331CC1916D2BC340037911A /* CTCViewController.h */,
141151
0331CC1A16D2BC340037911A /* CTCViewController.m */,
142152
0331CC1C16D2BC340037911A /* CTCViewController.xib */,
143-
0331CC0816D2BC330037911A /* Supporting Files */,
153+
0331CCC716D3F6820037911A /* ResponseA.json */,
154+
0331CCC916D3F8600037911A /* ResponseB.json */,
155+
0331CCCB16D3F87A0037911A /* ResponseC.json */,
156+
0331CCCF16D3F8BB0037911A /* ResponseD.json */,
157+
0331CCD116D3F8CA0037911A /* ResponseE.json */,
144158
D1A9640FB1434F9E98A40B64 /* Model */,
159+
0331CC0816D2BC330037911A /* Supporting Files */,
145160
);
146161
path = "KVC Validation Pattern";
147162
sourceTree = "<group>";
@@ -163,24 +178,27 @@
163178
D1A9640FB1434F9E98A40B64 /* Model */ = {
164179
isa = PBXGroup;
165180
children = (
166-
D1A96FDA94E719E970ACD8D1 /* CTCBaseModel.m */,
167181
D1A96AC843999D5242A3C415 /* CTCBaseModel.h */,
168-
D1A96C133C16E9532FEA9D77 /* NSString+Utilities.m */,
182+
D1A96FDA94E719E970ACD8D1 /* CTCBaseModel.m */,
169183
D1A9697EA73C7580ADBD935A /* NSString+Utilities.h */,
184+
D1A96C133C16E9532FEA9D77 /* NSString+Utilities.m */,
170185
D1A9649CC08AFC85AF889CE2 /* Validation */,
171-
D1A96109D2CD25E51B9DC18F /* CTCStation.m */,
172186
D1A9634AAEA04A7DAC761FB9 /* CTCStation.h */,
173-
D1A96DAB6710395F2577CAA3 /* CTCAddress.m */,
187+
D1A96109D2CD25E51B9DC18F /* CTCStation.m */,
174188
D1A96A4A42FF9FB0178DA2BD /* CTCAddress.h */,
175-
D1A963FA34856D738D23FCE5 /* CTCHistoricalPrice.m */,
189+
D1A96DAB6710395F2577CAA3 /* CTCAddress.m */,
176190
D1A96A254F4AF318022696FB /* CTCHistoricalPrice.h */,
191+
D1A963FA34856D738D23FCE5 /* CTCHistoricalPrice.m */,
177192
);
178193
path = Model;
179194
sourceTree = "<group>";
180195
};
181196
D1A9649CC08AFC85AF889CE2 /* Validation */ = {
182197
isa = PBXGroup;
183198
children = (
199+
D1A9631937B4815842753788 /* ValidationFunctions.h */,
200+
D1A960BB8118621FAC9EC597 /* CTCBaseModelValidator.h */,
201+
D1A96F977C69F2AEB680CF33 /* CTCBaseModelValidator.m */,
184202
D1A96B6E1AD55C1C9EC59F97 /* CTCArrayTypeValidator.h */,
185203
D1A965D6EE2DC8E368276665 /* CTCArrayTypeValidator.m */,
186204
D1A9682FCF8E44DE2645C622 /* CTCBaseValidator.h */,
@@ -195,17 +213,14 @@
195213
D1A96431BB0178BFF883997B /* CTCNumberTypeValidator.m */,
196214
D1A967B31A2F6F35B7A26450 /* CTCStringTypeValidator.h */,
197215
D1A969301137DB19C2E681C4 /* CTCStringTypeValidator.m */,
198-
D1A965882BA8DE414198C4BB /* CTCIntegerTypeValidator.m */,
199216
D1A960242C2D383AC3DEAC1C /* CTCIntegerTypeValidator.h */,
200-
D1A96F8FFAE93D1CA79F847E /* CTCDictionaryTypeValidator.m */,
217+
D1A965882BA8DE414198C4BB /* CTCIntegerTypeValidator.m */,
201218
D1A9603D974FAEAA5655C472 /* CTCDictionaryTypeValidator.h */,
202-
D1A9633A6D221155B7466BCC /* CTCUnsignedIntegerTypeValidator.m */,
219+
D1A96F8FFAE93D1CA79F847E /* CTCDictionaryTypeValidator.m */,
203220
D1A9608DF3D8068F64698BC3 /* CTCUnsignedIntegerTypeValidator.h */,
204-
D1A96EBE1A57032C1359BB0D /* CTCDoubleTypeValidator.m */,
221+
D1A9633A6D221155B7466BCC /* CTCUnsignedIntegerTypeValidator.m */,
205222
D1A963B4A978AB7D6900FAEC /* CTCDoubleTypeValidator.h */,
206-
D1A96F977C69F2AEB680CF33 /* CTCBaseModelValidator.m */,
207-
D1A960BB8118621FAC9EC597 /* CTCBaseModelValidator.h */,
208-
D1A9631937B4815842753788 /* ValidationFunctions.h */,
223+
D1A96EBE1A57032C1359BB0D /* CTCDoubleTypeValidator.m */,
209224
);
210225
path = Validation;
211226
sourceTree = "<group>";
@@ -267,6 +282,11 @@
267282
0331CC1616D2BC340037911A /* Default@2x.png in Resources */,
268283
0331CC1816D2BC340037911A /* Default-568h@2x.png in Resources */,
269284
0331CC1E16D2BC340037911A /* CTCViewController.xib in Resources */,
285+
0331CCC816D3F6820037911A /* ResponseA.json in Resources */,
286+
0331CCCA16D3F8600037911A /* ResponseB.json in Resources */,
287+
0331CCCC16D3F87A0037911A /* ResponseC.json in Resources */,
288+
0331CCD016D3F8BB0037911A /* ResponseD.json in Resources */,
289+
0331CCD216D3F8CB0037911A /* ResponseE.json in Resources */,
270290
);
271291
runOnlyForDeploymentPostprocessing = 0;
272292
};
@@ -421,6 +441,7 @@
421441
0331CC2316D2BC340037911A /* Release */,
422442
);
423443
defaultConfigurationIsVisible = 0;
444+
defaultConfigurationName = Release;
424445
};
425446
/* End XCConfigurationList section */
426447
};

KVC Validation Pattern/KVC Validation Pattern/CTCViewController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
@interface CTCViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
1212

13+
@property(nonatomic,strong) IBOutlet UITextView *sourceTextView;
1314
@property(nonatomic,strong) IBOutlet UITableView *tableView;
1415
@property(nonatomic,strong) IBOutlet UIBarButtonItem *viewJSONButton;
1516
@property(nonatomic,strong) IBOutlet UISegmentedControl *responseSegmentedControl;

0 commit comments

Comments
 (0)