0

How should be defined a dictionary of options for a pageViewController for a PDFView from PDFKit?

I am interested particulari with this flag

UIPageViewController.NavigationOrientation.horizontal

let pdfv = PDFView.init(frame: self.view.frame)

let opt = ?????

pdfv.usePageViewController(true, withViewOptions: opt)
Blazej SLEBODA
  • 8,936
  • 7
  • 53
  • 93

1 Answers1

2

The ViewOptions contains only 2 options: interPageSpacing and spineLocation: https://developer.apple.com/documentation/uikit/uipageviewcontroller/optionskey

Exemple: pdfv.usePageViewController(true, withViewOptions: ["interPageSpacing": 50])

If you want to change the pageViewController direction to horizontal, use this code:

pdfv.displayDirection = .horizontal

Hope this helps.

qtngo
  • 1,594
  • 1
  • 11
  • 13
  • 2
    Carreful with those 2 lines with ios13 : I was settings the displayDirection to .horizontal but it kept showing in vertical mode...starting ios13 it seems you have to call pdf.usePageViewController(withViewOptions:) AFTER pdf.displayDirection setter. – Adrian Oct 02 '19 at 12:15