PDFView size


I’m looking for some help. I have a UIViewController that display a PDF with multiple pages.


import UIKit
import PDFKit

class SafetyPDF: UIViewController {
    override func viewDidLoad() {

        let pdfView = PDFView(frame: UIScreen.main.bounds)
        let url = Bundle.main.url(forResource: "FINAL_PowerPalletManual", withExtension: "pdf")
        pdfView.document = PDFDocument(url: url!)

    override func didReceiveMemoryWarning() {
        // Dispose of any resources that can be recreated.
    @IBAction func goBAckButton(_ sender: Any) {
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.


It works. However, it covers the goBack button to navigate back to the the first viewcontroller.

Any suggestion to fix this problem?

Powered by WPeMatico


You may also like...

Comments are closed.