A personal project to taste ReactiveCocoa (ReactiveObjc) for a parsing problem. The project is NOT production-ready.
ePub parser for iOS and OS X. Core parts are designed to be reactive and are written in ReactiveCocoa.
NSString *soucePath = ... /// path of the .zip or .epub file
NSString *destinationPath = ... /// destination folder to unarchive
self.parser = [RBParser parserWithSourcePath:sourcePath destinationPath:destinationPath];
[self.parser.startParsingWithCompletionBlock:^(RBEpub * _Nullable epub, NSError * _Nullable error) {
/// process data here
}];
This type of usage is built on the reactive-functional approach (based on the ReactiveCocoa 2.0 framework)
[[[self.parser startCommand].executionSignals
flattenMap:^(RACSignal *parsingSignal) {
return parsingSignal;
}]
subscribeNext:^(RBEpub *epub) {
/// do additional stuff with parsed epub data
}
error:^(NSError *error) {
/// process error
}];
NSString *soucePath = ... /// path of the .zip or .epub file
NSString *destinationPath = ... /// destination folder to unarchive
/// Start of the actual parsing
[[self.parser startCommand] execute:RACTuplePack(sourcePath, destinationPath)];
ReactiveBeaver code is available under the MIT license. See LICENSE for details.
All sources and compile tools were get from https://github.com/IDPF/epub3-samples Books are used only for testing purpose.
Unless specified otherwise in the samples table, all samples are licensed under CC-BY-SA 3.0
yury.lapitsky@gmail.com