Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.
/ FolioReaderKit Public archive

๐Ÿ“š A Swift ePub reader and parser framework for iOS.

License

Notifications You must be signed in to change notification settings

FolioReader/FolioReaderKit

Repository files navigation

FolioReader logo FolioReaderKit is an ePub reader and parser framework for iOS written in Swift.

Installation

FolioReaderKit is available through CocoaPods and Carthage.

Cocoapods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate FolioReaderKit into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'FolioReaderKit', '~> 0.8'
end

Or if trying the demo, move to the example directory

$ cd Example

Then, run the following command:

$ pod install

Alternatively to give it a test run, run the command:

$ pod try FolioReaderKit

Carthage

Add the following to your Cartfile

github "FolioReader/FolioReaderKit"

Run the following command:

$ carthage update

Then, follow the steps as described in Carthage's README.

Requirements

  • iOS 8.0+
  • Xcode 7.3+

Basic Usage

To get started, this is a simple usage sample of using the integrated view controller.

import FolioReaderKit

func open(sender: AnyObject) {
    let config = FolioReaderConfig()
    let bookPath = NSBundle.mainBundle().pathForResource("book", ofType: "epub")
    FolioReader.presentReader(parentViewController: self, withEpubPath: bookPath!, andConfig: config)
}

You can also use your own FolioReader View Controller like this.

let config = FolioReaderConfig()
let bookPath = NSBundle.mainBundle().pathForResource("book", ofType: "epub")
let epubVC = FolioReaderContainer(config: config, epubPath: bookPath!, removeEpub: true)

// Present the epubVC view controller like every other UIViewController instance
presentViewController(epubVC, animated: true, completion: nil)

In your AppDelegate call applicationWillResignActive and applicationWillTerminate. This will save the reader state even if you kill the app.

import FolioReaderKit

func applicationWillResignActive(application: UIApplication) {
    FolioReader.applicationWillResignActive()
}

func applicationWillTerminate(application: UIApplication) {
    FolioReader.applicationWillTerminate()
}

Features

  • ePub 2 and ePub 3 support
  • Custom Fonts
  • Custom Text Size
  • Text Highlighting
  • List / Edit / Delete Highlights
  • Themes / Day mode / Night mode
  • Handle Internal and External Links
  • Portrait / Landscape
  • Reading Time Left / Pages left
  • In-App Dictionary
  • Media Overlays (Sync text rendering with audio playback)
  • TTS - Text to Speech Support
  • Parse epub cover image
  • Vertical or/and Horizontal scrolling
  • RTL Support
  • PDF support
  • Book Search
  • Add Notes to a Highlight

Demo

Custom Fonts ๐Ÿ˜

Custom fonts

Day and Night Mode ๐Ÿ˜Ž

Day night mode

Text Highlighting ๐Ÿ˜

Highlight

Reading Time Left ๐Ÿ˜ฎ

Time left

Media Overlays ๐Ÿ˜ญ

Time left

Documentation

For now the best documentation is the sample project. I will write a better am working to improve the code documentation, this is the current progress: CocoaPods

You have a problem that cannot be solved by having a look at the example project? No problem, let's talk: Join the chat at https://gitter.im/FolioReader/FolioReaderKit

Author

Heberti Almeida

Donations

This project needs you! If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, feel free to donate. Your donation is highly appreciated. Thank you!

PayPal

License

FolioReaderKit is available under the BSD license. See the LICENSE file.