WLReader
epub, txt reader, swift
Install / Use
/learn @coderWeil/WLReaderREADME
WLReader
epub, txt reader, swift
说明
WLReader 中只提供了阅读器实现方式,关于笔记,划线,书签等功能需要和业务关联,调用接口相关操作,这里只给出实现方式,有使用到的可以根据自己业务场景调试即可
功能概括
- html解析,采用DTCoreText库,包含对图片,链接等各种特殊标签的特殊定制样式,展示等
- epub,txt解析
- 翻页方式:仿真,平移,覆盖,无效果,滚动
- 字体,字号切换
- 背景色更换
- 长按选中
- 笔记划线,笔记列表
- 书签功能(收藏)
- 书籍列表(包含章节中分小节的,目前只支持二级章节)
- 网络下载,本地书籍的解析
- 阅读进度的缓存
使用方式
将demo中的WLReader拖入项目中,配置好Pofile依赖库:
pod 'SnapKit'
pod 'DTCoreText'
pod 'SSZipArchive'
pod 'AEXML'
pod 'WCDB.swift'
执行pod install 即可
@objc private func fastRead() {
let path = Bundle.main.path(forResource: "xxx", ofType: "epub")
let read = WLReadContainer()
read.bookPath = path
self.navigationController?.pushViewController(read, animated: true)
}
下面是针对不同功能点,可以去具体博客查看:
-
图片相关处理,包括对图片做笔记后的样式调整,长按,点击查看大图等功能 图片处理
-
笔记划线功能实现思路 笔记划线
-
长按选中文本的相关处理 长按选中文本
-
章节中有小章节划分的多级目录处理 多级目录处理
-
WLReader 简介 WLReader简介
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
