Send pdf file in Email iOS Swift

import UIKit
import MessageUI
class PDFViewController: BaseViewController {
//MARK: - OVERRIDE METHODS
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
//MARK: - Custom Method
 func sendEmail() {
        if MFMailComposeViewController.canSendMail() {
            let mailComposeViewController = MFMailComposeViewController()
            mailComposeViewController.mailComposeDelegate = self
            mailComposeViewController.setSubject("abc.pdf")
            mailComposeViewController.addAttachmentData(NSData(contentsOfFile: "abc.pdf")! as Data, mimeType: "application/pdf",       fileName: "abc.pdf")
            present(mailComposeViewController, animated: true, completion: nil)
        }
    }
}
extension PDFViewController: MFMailComposeViewControllerDelegate {
    func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
        
        controller.dismiss(animated: true, completion: nil)
    }
}