Coder Social home page Coder Social logo

hhy5277 / reader-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ggghub/reader

0.0 1.0 0.0 16.79 MB

iOS基于CoreText实现的电子书阅读器,支持txt,epub格式

Home Page: https://github.com/GGGHub/Reader

Objective-C 66.94% Objective-C++ 4.79% C 25.30% C++ 2.98%

reader-1's Introduction

Reader

2020.5.4

谢谢大家对我这个项目这么支持。这个阅读的项目已经很久没有更新了。

很抱歉,这么多的问题我没有及时解决。

这里有一个很好的小说阅读器项目,大家如果想要学习可以关注一下。

https://github.com/yuenov/reader-ios

https://github.com/yuenov/reader-android


基于Core Text实现的iOS客户端的电子书阅读器
支持ePub与text格式


2016.11.22 更新

  • 添加对ePub格式电子书的阅读排版支持
  • 添加对ePub格式电子书的图片显示支持

部分功能实现效果

关于Reader

  1. 可以自动提取章节并生成目录
  2. 选取一段文字可进行复制,做笔记等功能
  3. 保存阅读进度,即使退出应用也可以继续之前的阅读
  4. 更改字体大小,进度跳转,主题更换等功能
  5. 支持txtePub格式的电子书文件

安装与使用

安装

  1. Reader目录下的所有文件都添加到工程中
  2. 由于解压ePub文件,需要用到开源的.c文件用于解压缩。所以使用时如果项目中有.pch文件参考本项目中.pch文件写法
#ifdef __OBJC__
//在.pch中这里写引用的.h文件与宏
#endif

3.需要导入libz.tbd

使用

text文件

   LSYReadPageViewController *pageView = [[LSYReadPageViewController alloc] init];
    NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"mdjyml"withExtension:@"txt"];
    pageView.resourceURL = fileURL;    //文件位置
    pageView.model = [LSYReadModel getLocalModelWithURL:fileURL];  //阅读模型
    [self presentViewController:pageView animated:YES completion:nil];

ePub文件

   LSYReadPageViewController *pageView = [[LSYReadPageViewController alloc] init];
    NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"细说明朝"withExtension:@"epub"];
    pageView.resourceURL = fileURL;    //文件位置
    pageView.model = [LSYReadModel getLocalModelWithURL:fileURL];  //阅读模型
    [self presentViewController:pageView animated:YES completion:nil];

提示

之前安装过的下载最新版,应把之前安装的卸载后再安装

说明

对于有图片和定制样式的epub文件只显示纯文本信息,因为对epub每个章节的html文件直接转成字符串来处理,css样式与epub自带的本地图片没有做处理。

reader-1's People

Contributors

bryant1410 avatar ggghub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.