Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Updating Motis Podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
vilanovi committed Apr 15, 2014
1 parent cc283f0 commit 9a68636
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Motis.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "Motis"
s.version = "0.3.2"
s.version = "0.4.0"
s.summary = "Easy JSON to NSObject mapping using Cocoa's Key Value Coding (KVC)"

s.description = <<-DESC
Expand All @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { "Mobile Jazz" => "[email protected]" }
s.social_media_url = "http://twitter.com/mobilejazzcat"
s.source = { :git => "https://github.com/mobilejazz/Motis.git", :tag => "0.3.2" }
s.source = { :git => "https://github.com/mobilejazz/Motis.git", :tag => "0.4.0" }
s.source_files = 'Motis.h', 'NSObject+Motis.{h,m}'
s.framework = 'Foundation'
s.requires_arc = true
Expand Down
2 changes: 1 addition & 1 deletion NSObject+Motis.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
*
* In order to use Motis you must define mappings between JSON keys and object properties by overriding the following methods:
*
* - `+mts_mapping`: Subclasses must override this method and return the mapping between the JSON keys and the object properties.
* - `+mts_mapping`: Subclasses must override this method and return the mapping between the JSON keys and the object properties. The mapping may contain KeyPath to JSON values.
* - `+mts_shouldSetUndefinedKeys`: Optionally, subclasses can override this method to forbid Motis from automatically setting keys not found in the mapping. The default is `YES`.
*
* VALIDATION METHODS
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ Your custom object (subclass of `NSObject`) needs to override the method `+mts_m
```objective-c
+ (NSDictionary*)mts_mapping
{
return @{@"json_attribute_key_1" : @"class_property_name_1",
@"json_attribute_key_2" : @"class_property_name_2",
return @{@"json__key_1" : @"class_property_name_1",
@"json_key_2" : @"class_property_name_2",
@"json_key_3.json_key_4" : @"class_property_name_3",
...
@"json_attribute_key_N" : @"class_property_name_M",
};
}
```

You can also use KeyPath to reference JSON content of dictionaries.

####2. Map and set your objects

After defining your mappings in step (1) you are ready to go:
Expand Down

0 comments on commit 9a68636

Please sign in to comment.