DUAReader是电子书阅读器,支持txt、epub(图文混排)、纯Swift编写、自动提取章节、支持翻页模式切换、更改背景、字体字号,章节跳转等各种常用功能。
DUAReader也全面支持Objective-C,兼容Objective-C的版本将在fitOC分支单独维护,获取方式:
克隆代码到本地gitclonehttps://github.com/nothot/DUAReader.git
切换到fitOC分支gitcheckout-bfitOCorigin/fitOC
示例 //txt示例 mreader=DUAReader()letconfiguration=DUAConfiguration.init()configuration.backgroundImage=UIImage.init(named:"backImg.jpg")mreader.config=configurationmreader.delegate=selfself.present(mreader,animated:true,completion:nil)letbookPath=Bundle.main.path(forResource:"郭黄之恋",ofType:"txt")mreader.readWith(filePath:bookPath!,pageIndex:1) //epub示例 mreader=DUAReader()letconfiguration=DUAConfiguration.init()configuration.backgroundImage=UIImage.init(named:"backImg.jpg") configuration.bookType=.epub//默认TXT类型 mreader.config=configurationmreader.delegate=selfself.present(mreader,animated:true,completion:nil)letepubPath=Bundle.main.path(forResource:"每天懂一点好玩心理学",ofType:"epub")mreader.readWith(filePath:epubPath!,pageIndex:1)
评论