PDFView size

Hello.

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() {
        super.viewDidLoad()

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

    override func didReceiveMemoryWarning() {
        super.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

About

You may also like...

Comments are closed.