title: Display PDF file in Swift 4
body: <pre><code>import UIKit
  import WebKit
  
  class ViewController: UIViewController, UIDocumentInteractionControllerDelegate {
  
      var docController: UIDocumentInteractionController!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          docController = UIDocumentInteractionController.init(url: URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(urlVal!))
          docController.delegate = self
          docController.presentPreview(animated: true)       
      }
  
  
      func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -&gt; UIViewController {
              return self
       }
  }
  </code></pre>
  
  <p>Above code I'm not able to display the pdf file. Can anyone help?</p>