From 861d2270a5a355fe4e26721fc4617c721f9b345c Mon Sep 17 00:00:00 2001 From: Vincil Bishop Date: Sun, 5 Jul 2015 17:54:43 -0500 Subject: [PATCH 1/3] Updated for iOS: 6 minimum deploy version --- ReactiveNSXMLParserLib/ReactiveNSXMLParser.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactiveNSXMLParserLib/ReactiveNSXMLParser.podspec b/ReactiveNSXMLParserLib/ReactiveNSXMLParser.podspec index 857e965..d29b4eb 100644 --- a/ReactiveNSXMLParserLib/ReactiveNSXMLParser.podspec +++ b/ReactiveNSXMLParserLib/ReactiveNSXMLParser.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # s.name = "ReactiveNSXMLParser" - s.version = "0.1.1" + s.version = "0.1.2" s.summary = "ReactiveCocoa extensions for NSXMLParser: A concise, stream-based API for parsing XML with NSXMLParser." s.description = <<-DESC @@ -29,7 +29,7 @@ Pod::Spec.new do |s| # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - s.ios.deployment_target = '5.0' + s.ios.deployment_target = '6.0' s.osx.deployment_target = '10.7' From e9561dadbbb13c478741c32f79f8cf9573a29bde Mon Sep 17 00:00:00 2001 From: Vincil Bishop Date: Sun, 5 Jul 2015 18:23:21 -0500 Subject: [PATCH 2/3] Updated to move podspec up one directory --- .../ReactiveNSXMLParser.podspec => ReactiveNSXMLParser.podspec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ReactiveNSXMLParserLib/ReactiveNSXMLParser.podspec => ReactiveNSXMLParser.podspec (100%) diff --git a/ReactiveNSXMLParserLib/ReactiveNSXMLParser.podspec b/ReactiveNSXMLParser.podspec similarity index 100% rename from ReactiveNSXMLParserLib/ReactiveNSXMLParser.podspec rename to ReactiveNSXMLParser.podspec From c9eaa1a15d2b8a85032ba6745d4023f587112c7f Mon Sep 17 00:00:00 2001 From: Vincil Bishop Date: Sun, 5 Jul 2015 19:16:52 -0500 Subject: [PATCH 3/3] Updated for more convenience methods --- .../Classes/NSXMLParser+ReactiveCocoa.h | 16 ++++++++++++++++ .../Classes/NSXMLParser+ReactiveCocoa.m | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/ReactiveNSXMLParserLib/ReactiveNSXMLParserLib/Classes/NSXMLParser+ReactiveCocoa.h b/ReactiveNSXMLParserLib/ReactiveNSXMLParserLib/Classes/NSXMLParser+ReactiveCocoa.h index 189af5c..88b81f6 100644 --- a/ReactiveNSXMLParserLib/ReactiveNSXMLParserLib/Classes/NSXMLParser+ReactiveCocoa.h +++ b/ReactiveNSXMLParserLib/ReactiveNSXMLParserLib/Classes/NSXMLParser+ReactiveCocoa.h @@ -73,4 +73,20 @@ typedef BOOL (^ElementFilterBlock)(NSString *elementName); + (RACSignal *)rac_dictionaryFromString:(NSString *)string elementFilter:(ElementFilterBlock)filterBlock; +/** + * Parse a XML using a pre-init'ed parser. + * + * @return RACSignal Will 'next' exactly once, with a NSDictionary parameter + */ +- (RACSignal *)rac_parser; + +/** + * Parse a XML using a pre-init'ed parser. + * + * @param filterBlock ElementFilterBlock (optional) Enables filtering on an element-name level + * + * @return RACSignal Will 'next' exactly once, with a NSDictionary parameter + */ +- (RACSignal *)rac_parserWithElementFilter:(ElementFilterBlock)filterBlock; + @end diff --git a/ReactiveNSXMLParserLib/ReactiveNSXMLParserLib/Classes/NSXMLParser+ReactiveCocoa.m b/ReactiveNSXMLParserLib/ReactiveNSXMLParserLib/Classes/NSXMLParser+ReactiveCocoa.m index aca2e39..a2515de 100644 --- a/ReactiveNSXMLParserLib/ReactiveNSXMLParserLib/Classes/NSXMLParser+ReactiveCocoa.m +++ b/ReactiveNSXMLParserLib/ReactiveNSXMLParserLib/Classes/NSXMLParser+ReactiveCocoa.m @@ -58,6 +58,16 @@ + (RACSignal *)rac_dictionaryFromData:(NSData *)data elementFilter:(ElementFilte return [self rac_dictionaryFromSignal:[self rac_parseData:data] elementfilter:filterBlock]; } +- (RACSignal *)rac_parser +{ + return [NSXMLParser rac_parseWithParser:self]; +} + +- (RACSignal *)rac_parserWithElementFilter:(ElementFilterBlock)filterBlock +{ + return [NSXMLParser rac_dictionaryFromSignal:[self rac_parser] elementfilter:filterBlock]; +} + #pragma mark - Internal /**