Swiftpack.co - Package - witekbobrowski/EPUBKit

Logo

CodacyBadge Swift CocoaPods Carthage Platforms Contact

📚 A simple swift library for parsing EPUB documents

Note: This library is still in its early stages! I will experiment and change the API until I am satisfied with the result. I do not reccomend using this library in larger projects (who am I fooling, nobody will use it anyway), although feedback will be highly appreciated 🙇

Installation

CocoaPods

Add the following to your Podfile:

pod 'EPUBKit', '~> 0.2.2'

Carthage

Add to Cartfile:

github "witekbobrowski/EPUBKit" ~> 0.2.2

Note: Swift Package Manager support coming soon 💃

Usage

Just import EPUBKit in your swift file.

import EPUBKit

Initialize document instance with URL of your EPUB document.

guard
    let path = Bundle.main.url(forResource: "steve_jobs", withExtension: "epub"),
    let document = EPUBDocument(url: path)
else { return }

If the document gets parsed correctly, you have access to full document metadata, contents, etc.

print(document.title)
> Steve Jobs
print(document.author)
> Walter Isaacson

Note: Documentation is not yet ready, but you should find it easy to explore the api by yourself 🙃

Contents

EPUBKit
├── EPUBKit.h
├── Info.plist
├── Model
│   ├── Creator.swift
│   ├── EPUBDocument.swift
│   ├── EPUBManifest.swift
│   ├── EPUBManifestItem.swift
│   ├── EPUBMediaType.swift
│   ├── EPUBMetadata.swift
│   ├── EPUBSpine.swift
│   ├── EPUBSpineItem.swift
│   └── EPUBTableOfContents.swift
└── Utils
    ├── EPUBParsable.swift
    ├── EPUBParser.swift
    └── EPUBParserError.swift

Github

link
Stars: 4
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

0.2.2 - May 28, 2018

  • Carthage support 🛒

0.2.1 - May 27, 2018

  • Source file refactoring 🗂

v0.1.0 - May 27, 2018

  • Initial version of parser 👨‍💼
  • Prototype views for displaying parsed documents 👨‍🎨

0.2.0 - May 26, 2018

  • CocoaPods support 🌴
  • Prototype views removed 🗑