I want to ask about something very important to me
I made an application containing buttons These buttons have PDF files
But when I click on the PDF file in the application I have several options QuickView , Print , Create PDF
Such as this picture
But can I when I click on a PDF file that opens automatically in Create PDF
?
Like what you see in the picture PDFAnnotation
i know how to open PDF file in swift but i want to open it in Create PDF
import UIKit
class ViewController: UIViewController {
lazy var document: UIDocumentInteractionController = {
let url = Bundle.main.url(forResource: "Steve", withExtension: "pdf")
let vc = UIDocumentInteractionController(url: url!)
vc.delegate = self
return vc
}()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
view.backgroundColor = UIColor.cyan
}
@IBAction func doAction1(_ sender: AnyObject) {
document.presentOptionsMenu(from: view.bounds, in: view, animated: true)
}
@IBAction func doAction2(_ sender: AnyObject) {
document.presentOptionsMenu(from: view.bounds, in: view, animated: true)
}
@IBAction func doAction3(_ sender: AnyObject) {
document.presentOptionsMenu(from: view.bounds, in: view, animated: true)
}
}
extension ViewController: UIDocumentInteractionControllerDelegate {
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self
}
}