Alua-Kinzhebayeva / iOS-PDF-Reader

PDF Reader for iOS written in Swift
MIT License
533 stars 150 forks source link

How to add multiple attributes to PDFViewController #43

Closed mohims closed 7 years ago

mohims commented 7 years ago

Hi, I'm having some trouble adding multiple attributes to the controller.

let documentURL = Bundle.main.url(forResource: "Cupcakes", withExtension: "pdf")!
let document = PDFDocument(fileURL: documentURL)!
let readerController = PDFViewController.createNew(with: document, actionStyle: .activitySheet)
navigationController?.pushViewController(readerController, animated: true)

if I now want to disable the thumbnails, I add the following to the code:

let readerController = PDFViewController.createNew(with: document, actionStyle: .activitySheet, isThumbnailsEnabled: false)

but i get an error: "argument 'isThumnailsEnabled' must precede argument 'actionStyle'"

Also when I want to change the scroll direction, it says that PDFViewController has no member 'scrollDirection'

controller.scrollDirection = .vertical

Please help :)

ranunez commented 7 years ago

I'm not experiencing these errors, can you confirm you are using v2.2.0? Can you fork the repo and modify the demo project so that we can investigate these errors you are experiencing? Thanks

mohims commented 7 years ago

I've added it to my project using cocoapods. In my pod file, I added pod 'PDFReader. It seems that it is not downloading the actual version...

Edit: I've checked the version that has been downloading. It's v2.1.6. Cocoapods seems no to download the latest release.... With pod update it downloads the latest version. Problem solved :)