RxEpub 0.0.7

RxEpub 0.0.7

Maintained by izhoubin.



 
Depends on:
SSZipArchive>= 0
RxSwift>= 0
RxCocoa>= 0
AEXML>= 0
 

RxEpub 0.0.7

  • By
  • izhoubin

RxEpub

CI Status Version License Platform Swift

Example

You can load epub from local or remote files whether it's unziped or not.

1. Load local epub

let url = Bundle.main.url(forResource: "330151", withExtension: "epub")

2. Load local epub (unziped)

let url = FileManager.default.urls(for: FileManager.SearchPathDirectory.cachesDirectory, in: .userDomainMask).first?.appendingPathComponent("Epubs").appendingPathComponent("330151")

3. Load remote epub

let url = URL(string: "http://d18.ixdzs.com/113/113933/113933.epub")

4. Load remote epub (unziped)

let url =  URL(string:"http://localhost/330151")

5 . Parse epub

RxEpubParser(url: url).parse().subscribe(onNext: {[weak self] (book) in
    print(book.title)
    print(book.author)
}

Open reader

let vc = RxEpubPageController(url:url)
navigationController?.pushViewController(vc, animated: true)

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 10.0+
  • Xcode 10+

Installation

RxEpub is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'RxEpub'

Author

izhoubin, [email protected]

License

RxEpub is available under the MIT license. See the LICENSE file for more info.