ios – UIkit QuickLook get frozen while editing document Swift


I am currently attempting to resolve a bug when a file is opened using QuickLook and the pen editing button is activated to modify the file. The problem arises when the user presses the “done” button without first deactivating the pen editing button.
This is part of the code that could be helpful.

override open func viewDidLoad() {
    super.viewDidLoad()
    navigationController?.navigationBar.configureBackButton()
    presenter?.viewLoaded()

    if completion != nil {
        let button = UIBarButtonItem(title: "general_done".localized, style: .done, target: self, action: #selector(done))
        navigationController?.navigationBar.addButton(button, at: .right)
        let button2 = UIBarButtonItem(title: "general_cancel".localized, style: .plain, target: self, action: #selector(close))
        navigationController?.navigationBar.addButton(button2, at: .left)
    }
}

@objc private func close() {
    print("close")
    completion?(false)
    dismiss()
}

@objc private func done() {
    print("done")
    completion?(true)
    dismiss()
}

screenshot

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img