Swiftpack.co - Package - Wobook/wobook-reader-ios

WobookReader for iOS


WobookReader for iOS

An incredible reading experience


Public releases of the iOS framework for CocoaPods

Table of Contents

Requirements

Swift 5.0+ Xcode 10.0+ iOS 11.0+

Installation

CocoaPods version CocoaPods platforms Latest release date Total downloads

CocoaPods

To install WobookReader using CocoaPods, add the following line to your Podfile:

pod 'WobookReader'

ATS

App Transport Security (ATS) is a technology that requires an app to either support best practice HTTPS security or statically declare its security limitations via a property in its Info.plist. ATS is officially documented in the NSAppTransportSecurity section of the Information Property List Key Reference.

You must add wobook.com as an exception to allow the HTTP calls of the reader.

  <key>NSAppTransportSecurity</key>
  <dict>
    <key>NSAllowsArbitraryLoads</key>
    <false/>
    <key>NSExceptionDomains</key>
    <dict>
      <key>wobook.com</key>
      <dict>
        <key>NSExceptionAllowsInsecureHTTPLoads</key>
        <true/>
        <key>NSExceptionMinimumTLSVersion</key>
        <string>TLSv1.2</string>
        <key>NSExceptionRequiresForwardSecrecy</key>
        <true/>
        <key>NSIncludesSubdomains</key>
        <true/>
        <key>NSRequiresCertificateTransparency</key>
        <false/>
        <key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
        <false/>
        <key>NSThirdPartyExceptionMinimumTLSVersion</key>
        <string>TLSv1.2</string>
        <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
        <true/>
      </dict>
    </dict>
  </dict>

Usage

import WobookReader

Initialializing the reader

let reader = WKReader(withURL: "https://httpbin.org/get",
                                withAPIKey: "XXX-XXX-XXX")

If you are connected and own the issue, you can add your readerKey:

let reader = WKReader(withURL: "https://httpbin.org/get",
                                withAPIKey: "XXX-XXX-XXX",
                                withReaderKey: "XXXXXXXX")

WKReader can also open an issue from a local path:

let reader = WKReader(withPath: "Folder/Issue/")

The parameters apiKey and readerKey are irrelevant when offline.

Presenting the reader

Present the reader from the UIViewController of your choice:

reader.present(from: self)

The WKReader will always present itself from the main thread.

Dismissal completion block

Block which is called when the modal controller has been dismissed:

var onDismiss: (() -> Void)?

Example:

reader.onDismiss = {
  print("The reader has been dismissed")
}

Customize

Main color for progress indicator if no progressColors are specified:

var mainColor: UIColor?

Example:

reader.mainColor = UIColor.blue

Colors used to create a gradient for progress indicator:

var progressColors: [CGColor]?

Example:

reader.progressColors = [UIColor.red.cgColor,
                         UIColor.orange.cgColor,
                         UIColor.yellow.cgColor]

The main color will be used if this parameter is nil, an empty array or contains less than 2 colors.

Placeholder used while loading thumbnails:

var placeholder: UIImage?

Example:

reader.placeholder = UIImage(named: "Placeholder")

Example

let reader = WKReader(withURL: "https://httpbin.org/get",
                                withAPIKey: "XXX-XXX-XXX",
                                withReaderKey: "XXXXXXXX")

reader.mainColor = UIColor.blue
reader.progressColors = [UIColor.red.cgColor,
                         UIColor.orange.cgColor,
                         UIColor.yellow.cgColor]
reader.placeholder = UIImage(named: "Placeholder")
reader.onDismiss = {
    print("The reader has been dismissed")
}

reader.present(from: self)

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

v3-ios - 2020-10-14 16:29:42

v2.5.2-ios - 2019-06-25 09:56:58

v2.5.1-ios - 2019-03-27 11:31:04

Update to Swift 5.

v2.4.1-ios - 2019-02-25 21:15:56

New

Remove Share option.

v2.3.1-ios - 2018-11-13 11:05:42

Improvements

Add the possibility to call a completion block when the reader has been dismissed.

v2.2.1-ios - 2018-10-31 17:45:11

iPad Release

Improvements

  • Improve HUD display on iPad
  • Improve orientation change
  • Improve hidding of Home Indicator
  • Remove orientation lock on iPad to allow split view

Fix

  • Fix landscape mode on iPad

v2.1.1-ios - 2018-10-23 17:09:50

Improvements

  • Update main color uses

Fix

  • Prevent display of HUD when changing orientation

v2.0.1-ios - 2018-10-23 14:49:15

Brand new version rewrote from scratch

Feature

  • Possibility to lock orientation at will
  • Change color background from black to white
  • Share current page
  • Landscape mode with double page
  • Page number indicator
  • Better HUD with animated show/hide

Fix and improvements

  • Reduce CPU and GPU usage
  • Remove all dependencies
  • Improve image loading and caching
  • Fix crash and other bugs

v1.2.1-ios - 2018-10-18 07:42:52

Improve caching. Fix bugs. Add and improve assets.

v1.1.3-ios - 2018-10-10 13:14:54

Update to Xcode 10, Swift 4.2. Update dependencies. Change development team reference.

v1.1.2-ios - 2018-10-10 10:57:00

Fix crashes, improve threads.