GithubHelp home page GithubHelp logo

vcan / reader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inspirelife96/reader

0.0 0.0 0.0 4.67 MB

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

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

Objective-C 64.43% Objective-C++ 6.21% C 29.36%

reader's Introduction

##Reader

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


###2016.10.02 更新 针对text小说的bug fix。

  1. 当字体变化时,小说有时候不会自动调整界面。
  2. 当字体变化时,还有小说的书签,笔记定位不准确,甚至程序崩溃。3.

大概思路:

  1. 当字体变化时,所有小说的章节都会基于新的字体重新调整,分页等。
  2. 记录笔记/书签文字开始位置的在整个章节中的下标位置,笔记/书签定位时,基于当前的字体分页,看当前的下标位置是否坐落在哪一页中,然后跳转到那一页。

###2016.06.16 更新 添加对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's People

Contributors

ggghub avatar inspirelife96 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.