RxEpub 0.0.7

RxEpub 0.0.7

izhoubin 维护。



 
依赖项
SSZipArchive>= 0
RxSwift>= 0
RxCocoa>= 0
AEXML>= 0
 

RxEpub 0.0.7

  • 作者:
  • izhoubin

RxEpub

CI Status Version License Platform Swift

示例

您可以从本地或远程文件加载 epub 文件,无论其是否解压。

1. 加载本地 epub

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

2. 加载本地 epub(解压)

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

3. 加载远程epub

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

4. 加载远程epub(解压后)

let url =  URL(string:"https:///330151")

5. 解析epub

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

打开阅读器

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

要运行示例项目,首先克隆仓库,然后从Example目录运行 pod install

要求

  • iOS 10.0+
  • Xcode 10+

安装

RxEpub可以通过CocoaPods获取。要安装它,请简单将以下行添加到您的Podfile中

pod 'RxEpub'

作者

izhoubin, [邮箱地址保护,请替换]

许可证

RxEpub遵循MIT许可证。有关更多信息,请参阅LICENSE文件。