Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to react to an already instantiated NSXMLParser #2

Merged
merged 3 commits into from
Jul 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down