From 50acf9be9bca07bfc7ed436dfe5b12e8ac3dd45c Mon Sep 17 00:00:00 2001 From: ipodishima Date: Mon, 29 Feb 2016 14:17:53 -0500 Subject: [PATCH] Podspec 0.0.2 --- CHANGELOG.md | 4 ++++ README.md | 16 ++++++++++++++-- WANetworkRouting.podspec | 9 ++++----- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4238bb..a4dc1c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,6 @@ +## 0.0.2 - Released Feb 29, 2015 +- Fixed an import with missing .h on main header +- Do not ask the store to delete an object if `nil` + ## 0.0.1 - Released Feb 26, 2015 Initial release \ No newline at end of file diff --git a/README.md b/README.md index e4c2869..1c2fee4 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,18 @@ WAMemoryStore *memoryStore = [[WAMemoryStore alloc] init]; WAMapper *mapper = [WAMapper newMapperWithStore:memoryStore]; WAReverseMapper *reverseMapper = [WAReverseMapper new]; +// Add a default date formatter on mapper +id(^toDateMappingBlock)(id ) = ^id(id value) { + if ([value isKindOfClass:[NSString class]]) { + return [dateFormatter dateFromString:value]; + } + + return value; +}; + +[mapper addDefaultMappingBlock:toDateMappingBlock + forDestinationClass:[NSDate class]]; + // Create the mapping description for `Enterprise` WAEntityMapping *enterpriseMapping = [WAEntityMapping mappingForEntityName:@"Enterprise"]; enterpriseMapping.identificationAttribute = @"itemID"; @@ -206,7 +218,7 @@ Please note that the `requestKeyPath` fits with how your object would be wrapped This allows you to post an object like this -``` +```objc Enterprise *enterprise = [Enterprise new]; enterprise.name = @"Test"; @@ -303,7 +315,7 @@ It's an other protocol (again): `WANRErrorProtocol` ### Create your own class The routing manager comes with a default error class which does nothing except being allocated. -``` +```objc @interface MyAPIError : NSObject @end diff --git a/WANetworkRouting.podspec b/WANetworkRouting.podspec index d0ef5d9..3174daa 100644 --- a/WANetworkRouting.podspec +++ b/WANetworkRouting.podspec @@ -1,15 +1,14 @@ Pod::Spec.new do |s| s.name = "WANetworkRouting" - s.version = "0.0.1" + s.version = "0.0.2" s.summary = "A routing library to fetch objects from an API and map them to your app" s.homepage = "https://github.com/Wasappli/WANetworkRouting" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "Marian Paul" => "marian@wasapp.li" } s.platform = :ios, "7.0" - s.source = { :git => "https://github.com/Wasappli/WANetworkRouting.git", :tag => "0.0.1" } + s.source = { :git => "https://github.com/Wasappli/WANetworkRouting.git", :tag => "0.0.2" } s.source_files = "Files/*.{h,m}" s.requires_arc = true - s.dependency "AFNetworking" - s.dependency "WAMapping" - + s.dependency 'AFNetworking', '~> 3.0' + s.dependency 'WAMapping', '~> 0.0.3' end