@objc func printData(){
let pic = UIPrintInteractionController.shared
let printInfo : UIPrintInfo = UIPrintInfo(dictionary: nil)
printInfo.outputType = UIPrintInfo.OutputType.general
pic.printInfo = printInfo
pic.printFormatter = self.webViewPrint.viewPrintFormatter()
pic.present(animated: true, completionHandler: nil)
}
Present working fine, app crashing when I have dismissing this view controller.
"webViewPrint" is a UIWebView
App crash log: 2020-09-25 12:20:19.399922+0530 void _WebThreadLock(), 0x13b425020: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...