DUAReader電子書閱讀器
DUAReader 是電子書閱讀器,支持txt、epub(圖文混排)、純 Swift 編寫、自動(dòng)提取章節(jié)、支持翻頁模式切換、更改背景、字體字號(hào),章節(jié)跳轉(zhuǎn)等各種常用功能。
DUAReader 也全面支持 Objective-C,兼 容Objective-C 的版本將在 fitOC 分支單獨(dú)維護(hù),獲取方式:
- 克隆代碼到本地
git clone https://github.com/nothot/DUAReader.git
- 切換到fitOC分支
git checkout -b fitOC origin/fitOC
示例
// txt示例
mreader = DUAReader()
let configuration = DUAConfiguration.init()
configuration.backgroundImage = UIImage.init(named: "backImg.jpg")
mreader.config = configuration
mreader.delegate = self
self.present(mreader, animated: true, completion: nil)
let bookPath = Bundle.main.path(forResource: "郭黃之戀", ofType: "txt")
mreader.readWith(filePath: bookPath!, pageIndex: 1)
// epub示例
mreader = DUAReader()
let configuration = DUAConfiguration.init()
configuration.backgroundImage = UIImage.init(named: "backImg.jpg")
configuration.bookType = .epub // 默認(rèn)TXT類型
mreader.config = configuration
mreader.delegate = self
self.present(mreader, animated: true, completion: nil)
let epubPath = Bundle.main.path(forResource: "每天懂一點(diǎn)好玩心理學(xué)", ofType: "epub")
mreader.readWith(filePath: epubPath!, pageIndex: 1)
評(píng)論
圖片
表情
