THPDFKit

PDF viewer component on top of Apples PDFKit

70
13
Swift

THPDFKit

Build Status
Pod Version
Pod Platform
Pod License
Coverage Status

PDF viewer component on top of Apples PDFKit

Screenshots

iPhone Portrait
iPhone Landscape

Installation

CocoaPods

Install with CocoaPods by adding the following to your Podfile:

platform :ios, '9.0'
use_frameworks!
pod 'THPDFKit', '~> 0.3.1'

Note: We follow http://semver.org for versioning the public API.

Usage

This is a sample initialization taken from the sample project which uses storyboards to define viewcontrollers and navigation.

However the only thing that is really needed is passing the URL to the PDF file to the Wrapper (If you wanna use the Quicklook fallback) or directly to the PDFKitViewController if you’re not targeting platforms below iOS11.

    // MARK: - Navigation

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let indexPath = tableView.indexPathForSelectedRow {
            let selectedRow = indexPath.row
            let detailVC = segue.destination as! PDFViewControllerWrapper
            detailVC.url = self.samplePDFs[selectedRow]

        }
    }

TODOs

  • Finally fix the broken TravisCI integration
  • Support for annotations
  • Improve podspec for iOS11 only version without Quicklook
  • Extend customizability (colors, sizes, fonts, …)
  • Support for CocoaLumberjack (for logging)

Contributions

…are really welcome. If you have an idea just fork the library change it and if its useful for others and not affecting the functionality of the library for other users I’ll insert it

License

Source code of this project is available under the standard MIT license. Please see the license file.