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

Overview

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

Version License

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
  • RTL Support
  • Vertical or/and Horizontal scrolling
  • Share Custom Image Quotes NEW
  • Support multiple instances at same time, like parallel reading NEW
  • Book Search
  • Add Notes to a Highlight

Who is using it?

On AppSight you can see apps that are using it in production.

Demo

Custom Fonts ๐Ÿ˜ Text Highlighting ๐Ÿ˜
Custom fonts Highlight
Reading Time Left ๐Ÿ˜ฎ Media Overlays ๐Ÿ˜ญ
Time left Media Overlays

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, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'FolioReaderKit'
end

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 --platform iOS --no-use-binaries

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

Requirements

  • iOS 9.0+
  • Xcode 10.1+

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 = Bundle.main.path(forResource: "book", ofType: "epub")
    let folioReader = FolioReader()
    folioReader.presentReader(parentViewController: self, withEpubPath: bookPath!, andConfig: config)
}

For more usage examples check the Example folder.

Storyboard

To get started, here is a simple example how to use the integrated view controller with storyboards.

import FolioReaderKit

class StoryboardFolioReaderContrainer: FolioReaderContainer {
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        
        let config = FolioReaderConfig()
        config.scrollDirection = .horizontalWithVerticalContent
        
        guard let bookPath = Bundle.main.path(forResource: "The Silver Chair", ofType: "epub") else { return }
        setupConfig(config, epubPath: bookPath)
    }
}

Go to your storyboard file, choose or create the view controller that should present the epub reader. In the identity inspector set StoryboardFolioReaderContrainer as class.

Documentation

Checkout Example and API Documentation

You can always use the header-doc. (use alt+click in Xcode)

Migration

If you are migrating to a newer version check out MIGRATION and CHANGELOG.

Author

Heberti Almeida

License

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

Comments
  • Add bookmarks

    Add bookmarks

    Hi guys ๐Ÿ‘‹

    We're trying to add bookmarking capability to FolioReaderKit

    Here is what I did so far

    1. Add a new allowBookmarking and localizedBookmarkTitle to FolioReaderConfig
    2. Add new bookmark button to the navigation bar
    3. Created a new Bookmark model (copied most of the code from the Highlight model) ๐Ÿ˜…
    4. Create a new BookmarkList UItableViewController
    5. Add a new Bookmarks segment next to Contents and Highlights

    What I was not able to do:

    1. Get the current fragment visible on screen so I can forward the user back when tapping on a bookmark in the BookmarkList view controller
    2. Set the navigation button's isHighlighted to true or false based on whether the currently visible page was bookmarked or not

    @hebertialmeida your help is highly appreciated, it would be nice to see Bookmark capability in FolioReaderKit soon ๐Ÿ’ฏ

    opened by omaralbeik 25
  • Fix incorrect menu on second highlight attempt

    Fix incorrect menu on second highlight attempt

    This fixes #170.

    I don't get what the logic is behind this. Why is createMenu called on menu dismiss, and not on menu show? Is it a sort of pre-rendering? What does the setMenuVisible(true, andRect: rect) call do? As it clearly doesn't show the menu, as it is being dismissed at that point.

    Nonetheless, it looks like, somehow, on long tap, the correct menu appears all the time, so there's no need to force the "share" menu.

    opened by revolter 7
  • Better support for iPhone X and NightMode Fix

    Better support for iPhone X and NightMode Fix

    Adds support for iPhone X regarding the PageIndicator (was hidden by the swipe home bar) Fixes night mode glitch (white pages / white borders on pages)

    opened by mgiroux 5
  • Carthage Support

    Carthage Support

    I had to restructure the directory structure a little bit, and tested both creating a new CocoaPods project and a new Carthage project with my fork.

    I had to add a pair of compiler directives for SSZipArchive and UIMenuItem_CXAImageSupport;

    • SSZipArchive drops the module prefix when installed through Carthage
    • UIMenuItem_CXAImageSupport doesn't seem to be the same between CocoaPods and Carthage so I changed the initializer depending on whether CocoaPods or Carthage is used.

    There is one final caveat: I had to add Carthage support to UIMenuItem and ZFDragableModalTransition, but my pull requests have not been accepted yet. When (if) they're accepted we'll need to update the FolioReader Cartfile to reference them instead of my forks (so we can keep getting upstream updates).

    That said, UIMenuItem is deprecated, so it may also be wise to update to the latest version of that (I added Carthage support to that one as well, also not merged yet).

    opened by alexpopov 4
  • ePub 3.0 media overlays can be played and example updated to demonstrate

    ePub 3.0 media overlays can be played and example updated to demonstrate

    Closes #11

    Please test the functionality and let me know if changes are needed. I figure there will be more features added as we think of them, but this if a start at basic audio synced epubs

    audio-player mov

    enhancement 
    opened by kjantzer 4
  • Fix App crashing on iOS 13

    Fix App crashing on iOS 13

    • Fix App crashing on iOS 13 ( Must return MPRemoteCommandHandlerStatus or take a completion handler as the second argument.)
    • Nav bar color
    • Text View Background (HighlightNote) is clear color (iOS13, Dark mode is black)
    opened by illwss 3
  • Feature/epub title in navbar

    Feature/epub title in navbar

    Added epub titles to the navbar. The feature was integrated with the config file. Devs can now set config.displayTitle = true to utilize the function. Left it off as default, project owner can decide if it should be on by default or not.

    opened by noxsicarius 2
  • Update realm to 3.0.2

    Update realm to 3.0.2

    Updating realm to version 3.0.2, All features seem to be working fine. I have also removed the forced versioning for realm. Any realm updates from from now on should automatically be applied upon using pod install or pod update. All future updates should also be compatible by nature so it should not have to be locked down again. Fixes #278

    opened by noxsicarius 2
  • re-indent all files

    re-indent all files

    As I saw, there were different indent style in FolioReaderKit and I thought it wasn't beautiful. So I am based on raywenderlich swift-style-guide to re-indent all files. You can see this guide from there.

    opened by Arcovv 2
  • Fix scroll direction being ignored on first run

    Fix scroll direction being ignored on first run

    Setting currentScrollDirection to .horizontal was ignored before the user changed it manually. Now, setting it like mentioned, the book scrolls horizontally as expected, and if the user changes it to vertical, it is respected by the app. Not setting the property still scrolls vertically by default, as before.

    opened by revolter 2
  • Provide a config which disables the readers `UIMenuController`

    Provide a config which disables the readers `UIMenuController`

    This PR adds a config which makes it possible to disable the default reader menu controller. By deactivating this it's possible for us to use custom menu entries.

    enhancement 
    opened by tschob 2
  • Migration/wkwebview

    Migration/wkwebview

    Here is my attempt to finish what @ricardohg started. Known issues so far:

    • You have to select a text couple of times in order to have an ability to play the audio from it.
    • The play button from menu also doesn't work before you select the text and make it to show play popup.
    • The pages counter doesn't always calculate correctly.
    opened by OrbitalMan 6
  • Feature: Two columns config.

    Feature: Two columns config.

    FolioReaderConfig.twoColumnsMode of type FolioReaderTwoColumnsMode.
    Modes:

    • .disabled (Default value)
    • .alwaysEnabled Enabled in any situation, iPhone or iPad, portrait or landscape orientation.
    • .onlyLandscape Enabled in any device, only landscape orientation.
    • .onlyIpad Enabled only on iPad, portrait or landscape orientation.
    • .onlyIpadLandscape Enabled only on iPad, only landscape orientation.
    • .onlyIphone Enabled only on iPhone, portrait or landscape orientation.
    • .onlyIphoneLandscape Enabled only on iPhone, only landscape orientation.

    iPad (Simulator) two columns ipad simulator

    iPhone (Real device) two columns iphone

    opened by wesleycgs 3
Releases(1.4.0)
  • 1.4.0(Jan 30, 2019)

    Full Changelog

    Merged pull requests:

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Feb 12, 2018)

    Full Changelog

    Fixed bugs:

    • shouldHideNavigationOnTap not working #268
    • Can't change UIWebView backgroundColor correctly when paginationBreakingMode is .page on night mode in iOS 10.3 #227

    Closed issues:

    • Can't compile after updating to Xcode 9 - errors in dependencies? #298
    • Latest Realm Dependency #294
    • How to add FolioReader as a subview in my custom view #293
    • Not installed by Carthage #291
    • Pod installation not compatible with swift 3/4 #288
    • Problems when use it with Carthage #286
    • text to speech for other languages #285
    • Build failure? #280
    • Realm version update #278
    • Pod error #273
    • Layout Issue After Integrating in Swift 4 #271
    • Unable to start with iOS Folio Reader /Swift3/Xcode 9 #266
    • Will FolioReaderKit support Swift 4.0? #263
    • 'FolioReader' initializer is inaccessible due to 'fileprivate' protection level #262
    • Error building for iOS 10 with MenuItemKit #260
    • whose view is not in the window hierarchy #259
    • not supporting swift 3.1 #256
    • Laggy on ios 9.3 (iPhone 6s Plus) #254
    • SemiNightmode #253
    • How to build the example? #252
    • audio voices #251
    • Has FolioReaderKit support read file from path local ? #250
    • Perform direct action instead of showing UIMenuController? #249
    • How to change default Green color in Folio UI #248
    • Problem with missing declarations #247
    • Is there a way to read the epub file from URL instead of from local ? #246
    • Core text replace WebView #245
    • Hi man, do u have objective-c Version? :) #244
    • Search Feature not found -- Feature Request #243
    • Could you please plan FolioReader for iOS written in Objective-C๏ผŸ #242
    • Why my NightMode cant change BGColor #231
    • epub responsive layout support #230
    • A white background at the bottom when set to horizontal scrolling #224
    • Access ePub metadata #182

    Merged pull requests:

    Cocoapods downloads:

    Total 46,389 Week 382 Month 2,082

    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(May 31, 2017)

    Implemented enhancements

    • Crash if "Cannot read container.xml" #164
    • Support multiple instances of the FolioReader #140

    Fixed bugs

    • Bug at scroll to next chapter in horizontal mode #173
    • Crash if "Cannot read container.xml" #164

    Closed issues

    • Epub file does not exist #240
    • Highlight a sentence when double click a word in a sentence #234
    • [FolioReaderKit.FolioReaderCenter respondsToSelector:]: message sent to deallocated instance 0x7fb6f6188a00 #217
    • Epub file does not exist. #216
    • Tap "Aa" button app crashed #215
    • Loading 2 epubs at the same time for language learners #214
    • Page Flip #209
    • Update Podfile description #205
    • Crashing After Highlight #186
    • return readerConfig.shouldHideNavigationOnTap == false ? false : shouldHideStatusBar #169

    Merged pull requests

    Code changes https://github.com/FolioReader/FolioReaderKit/compare/1.1.0...1.2.0

    Cocoapods downloads:

    Total 24,937 Week 524 Month 2,975

    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Jan 10, 2017)

    Fixed bugs:

    Bug with open FolioReader from the controller with keyboard #187 The app sometimes crashes when I try to present FolioReader for not first time #168 UISearchBar causes error after appearing of FolioReaderContainer #163 Unable to integrate using carthage #98 Closed issues:

    Closed issues:

    Excuse me, how can I make it support iOS 7? #201 Crash FolioReader after edit UITextField #199 Search and Notes Feature #198 Question about Javascript function. #195 Working with epub created with iBooks Author app #193 Not Sure How To Use Font Blaster #192 Unable to install latest version via CocoaPods #188 How can I disable PageIndicator #185 Pod version conflict with Realm swift #175 Can't run Example #174 Module compiled with Swift 3.0.1 #172 Install version with swift3 #171 Long press show delete menu rather than highlight option #170 cannot open epub file #167 Night mode tint color, menu text color #166 How can I use it in xCode8? #165 Custom Text Overlay #113 Merged pull requests:

    Merged pull requests:

    Create variable hidePageIndicator to hide page indicator. #196 (@EmersonCarpes) set webView's scroll delegate to nil in deinit in FolioReaderPage #194 (@tiana890) Fixed code style #191 (@revolter) Swift 3 syntax && Carthage hint #189 (@piechart) Add custom ePub unzip path option #181 (@revolter) Add methods returning Epub's title and Author #179 (@Vandeth) Fix scroll direction being ignored on first run #178 (@revolter) Fix incorrect menu on second highlight attempt #177 (@revolter) Fix warnings about exceding UIColor range #176 (@revolter)

    Code changes https://github.com/FolioReader/FolioReaderKit/compare/1.0.0...1.1.0

    Cocoapods downloads:

    Total 14,443 Week 453 Month 1,728

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Oct 7, 2016)

    Xcode 8 release, Swift 3

    • Fixed Quote Image bug;
    • Fixed other bugs;
    • Fixed code warnings;
    • Fixed Carthage.

    Code changes https://github.com/FolioReader/FolioReaderKit/compare/0.9.4...1.0.0

    Cocoapods downloads: Total 8,138 Week 441 Month 2,282

    Source code(tar.gz)
    Source code(zip)
  • 0.9.4(Oct 6, 2016)

    Xcode 8 release, Swift 2.3

    • Fixed Quote Image bug;
    • Fixed other bugs.

    Code changes https://github.com/FolioReader/FolioReaderKit/compare/0.9.3...0.9.4

    Source code(tar.gz)
    Source code(zip)
  • 0.9.3(Oct 6, 2016)

    Xcode 7.3.1 release, Swift 2.2

    • Fixed Quote Image bug;
    • Fixed other bugs.

    Code changes https://github.com/FolioReader/FolioReaderKit/compare/0.9.2...0.9.3

    Cocoapods downloads: Total 7,958 Week 309 Month 2,134

    Source code(tar.gz)
    Source code(zip)
  • 0.9.2(Sep 20, 2016)

    • Fixed SSZipArchive bug;
    • Fixed dependencies bugs.

    Code changes https://github.com/FolioReader/FolioReaderKit/compare/0.9.1...0.9.2

    Cocoapods downloads: Total 6,701 Week 615 Month 1,534

    Source code(tar.gz)
    Source code(zip)
  • 0.9.1(Sep 20, 2016)

  • 0.9.0(Sep 20, 2016)

    • Share custom image quote;
    • Advanced closures introduction;

    Code changes https://github.com/FolioReader/FolioReaderKit/compare/0.8.6...0.9.0

    Source code(tar.gz)
    Source code(zip)
  • 0.8.5(Aug 17, 2016)

  • 0.8.3(Aug 11, 2016)

  • 0.8.2(Aug 10, 2016)

  • 0.8.1(Aug 3, 2016)

  • 0.8.0(Jul 28, 2016)

    This is a huge release ๐ŸŽ‰, we have added a lot of new features and fixed many bugs.

    • Improved TTS support for any language and fixed some bugs;
    • Refactored TOC menu, now everything is easily accessible;
    • Horizontal and vertical scrolling support;
    • Ability to change orientation from menu;
    • Fixed highlight bugs;
    • Correct scroll position when rotate device.

    There is some minor improvements that I don't remember.

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Jun 8, 2016)

  • 0.6.6(May 5, 2016)

  • 0.6.4(May 2, 2016)

  • 0.6.3(Apr 25, 2016)

  • 0.6.0(Apr 1, 2016)

  • 0.5.0(Jan 27, 2016)

  • 0.4.1(Jan 25, 2016)

  • 0.4.0(Jan 25, 2016)

    • Refactored config vars;
    • Improved ScrollScrubber usability;
    • Improved Night mode colors;
    • Safe check arrays for existing index to avoid crashes.
    Source code(tar.gz)
    Source code(zip)
  • 0.3.9(Jan 20, 2016)

  • 0.3.8(Jan 14, 2016)

Owner
FolioReader
The best ePub reader.
FolioReader
An iOS PDF viewer and annotator written in Swift that can be embedded into any application.

Requirements iOS 9 or above Xcode 8 or above Swift 3.0 Note This project is still in early stages. Right now the PDF reader works both programmaticall

UXM Studio 269 Dec 11, 2022
PLHKit: A Swift DSL for Rendering and creating PDF Files.

PLHKit PLH is a tribute to Portsaid Light House, Port Said Lighthouse was the first building in the world created with reinforced concrete. ?? PLHKit

null 10 Sep 2, 2022
Draw Week Time Table on PDF using PDFKit in iOS Swift

DrawPDFTimeTable Draw Week Time Table on PDF using PDFKit in iOS Swift. Image Info This is the pdf of time table drawn using PDFKit in iOS Swift with

Kushagra Chandra 6 Nov 22, 2022
Mephisto - A command line tool to convert Comic Book Zip archives to PDF and share them over AirDrop

mephisto A command line tool written in Swift to convert Comic Book Zip archives

null 0 Feb 7, 2022
About PDFKit learning project on iOS 11, Like iBooks.app.

iBook About PDFKit learning project on iOS 11, Like iBooks.app. ไนฆๅบ“ ไนฆๅบ“้กต้ข่Žทๅ–PDF็›ธๅ…ณๆ•ฐๆฎ, ๅฏไปฅ้€š่ฟ‡KVC่Žทๅ–ใ€‚ PDFไนฆๅ if let title = documentAttributes["Title"] as? Stri

Jovins 31 Sep 15, 2022
TPPDF is a simple-to-use PDF builder for iOS

TPPDF is a fast PDF builder for iOS & macOS using simple commands to create advanced documents! Created and maintained by Philip Niedertscheider and a

techprimate 582 Jan 6, 2023
A Static Library to be embedded on iOS applications to display pdf documents derived from Fast PDF

FastPdfKit This repository contains the FastPdfKit iOS library with some sample projects. FastPdfKit is a library that let you show pdf documents in i

Dimension 1.2k Dec 22, 2022
Small utility to import PDF slides as vector images into Keynote for iOS.

Small utility to import PDF files into Keynote for iOS. This utility is especially helpful when presenting slideshows created by LaTeX

Luming Yin 6 Jun 14, 2022
TPPDF is a simple-to-use PDF builder for iOS

TPPDF is a fast PDF builder for iOS & macOS using simple commands to create advanced documents! Created and maintained by Philip Niedertscheider and a

techprimate 581 Dec 29, 2022
A simple generator of PDF written in Swift.

Features | Requirements | Installation | Usage | Communication | LICENSE PDFGenerator PDFGenerator is a simple PDF generator that generates with UIVie

Suguru Kishimoto 712 Dec 29, 2022
SimplePDF is a wrapper of UIGraphics PDF context written in Swift.

SimplePDF is a wrapper of UIGraphics PDF context written in Swift. You can: add texts, images, spaces and lines, table set up page layout, adjust cont

Nutchaphon Rewik 238 Dec 29, 2022
PdfBuilder: a swift library made to make creation of the Pdf file from code simpler

PdfBuilder PdfBuilder is a swift library made to make creation of the Pdf file f

null 4 Jul 22, 2022
Swift package that uses WebKit to render PDF files from URLs

Swift package for generating a PDF file from a URL (rendered by WebKit)

aaronland 1 Feb 25, 2022
๐Ÿ“š A Swift ePub reader and parser framework for iOS.

FolioReaderKit is an ePub reader and parser framework for iOS written in Swift. Features ePub 2 and ePub 3 support Custom Fonts Custom Text Size Text

FolioReader 2.5k Jan 8, 2023
A credit card reader and parser for iOS Using Native Vision/VisionKit

card-reader-ios A credit card reader and parser for iOS Using Native Vision/VisionKit May-14-2021.00-43-17.mp4 Instructions Hold camera up to a card a

Khalid Asad 104 Dec 15, 2022
1D and 2D barcodes reader and generators for iOS 8 with delightful controls. Now Swift.

RSBarcodes, now in Swift. RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate

R0CKSTAR 685 Jan 2, 2023
Free and open source manga reader for iOS and iPadOS.

Aidoku A free and open source manga reading application for iOS and iPadOS. Features Ad free Robust WASM source system Online reading through external

null 421 Jan 2, 2023
RSS reader for macOS and iOS.

NetNewsWire Itโ€™s a free and open-source feed reader for macOS and iOS. It supports RSS, Atom, JSON Feed, and RSS-in-JSON formats. More info: https://n

Ranchero Software 6.3k Dec 29, 2022
A free and open source xkcd comic reader for iOS.

A free, ad-free, open-source, native, and universal xkcd.com reader for iOS. Download it from the app store now! Architecture AFNetworking for network

Mike 249 Dec 12, 2022
RSS reader specific for Swift and SwiftUI based feeds.

Swift News Jam! Getting Started The idea behind this app was to provide the SwiftUI community a single app to curate the numerous RSS feeds that have

hallux 13 Nov 29, 2022