     }
     
     func displayAttachment() {
-        attachmentUrl = URL(string: content.attachment!.attachmentUrl)!
+        let attachmentUrl = URL(string: content.attachment!.attachmentUrl)!
         if attachmentUrl.pathExtension != "pdf" {
             viewAttachmentButton.isHidden = true
         } else {

    @IBOutlet weak var bookmarkAnimationContainer: UIView!
    
    var content: Content!
    var attachmentUrl: URL!
    var bookmark: Bookmark!
    var position: Int!
    var loading: Bool = false

    }
    
    @IBAction func viewAttachment(_ sender: UIButton) {
        var attachmentUrl = URL(string: content.attachment!.attachmentUrl)!
        if attachmentUrl.scheme == "http" {
            attachmentUrl = URL(string: "https://" + attachmentUrl.host! + attachmentUrl.path
                + "?" + attachmentUrl.query!)!
        }
        present(alertController, animated: false, completion: {
            self.loadPdf(url: attachmentUrl)
        })
    }
    
    func loadPdf(url: URL) {
        let pdfDocument = PDFDocument(url: url)
        alertController.dismiss(animated: false, completion: {
            self.displayPdf(pdfDocument)
        })
