Skip to content

CaptainTeemo/TMJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TMJSON

Version License Platform

TMJSON provides a safe and easy way to play with JSON, totally inspired by SwiftyJSON.

Requirements

  • iOS 7.0+
  • Xcode 7

Adding to your project

Using CocoaPods

Just add pod 'TMJSON' to your Podfile.

Example

Usage is quite similar to SwiftyJSON.

TMJSON *json = [[TMJSON alloc] initWithObject:responseObject];
        
NSArray *rootArray = json.arrayValue;
NSLog(@"array: %@", rootArray);
        
TMJSON *firstObject = rootArray[0];
NSString *wrongKey = firstObject[@"Teemo"].stringValue;
NSLog(@"wrongKey: %@", wrongKey);
        
NSString *name = firstObject[@"name"].stringValue;
NSLog(@"name: %@", name);
        
NSDictionary *address = firstObject[@"address"].dictionaryValue;
NSLog(@"address: %@", address);
        
double latitude = firstObject[@"address"][@"geo"][@"lat"].doubleValue;
NSLog(@"lat: %f", latitude);

License

TMJSON is available under the MIT license. See the LICENSE file for more info.

About

An awesome way to deal with JSON in Objective-C

Resources

License

Stars

Watchers

Forks

Packages

No packages published