printing - swift : Can I print a view Without going through the print dialog -


i trying print view button click, cannot escape print dialog asks how many copies , choosing printer machine, possible print directly in background of app without showing print dialog(popup)

what did :

func printer(){      let printcontroller = uiprintinteractioncontroller.shared      let printinfo = uiprintinfo(dictionary: nil)     printinfo.jobname = "print ticket"     printinfo.outputtype = .grayscale       printcontroller.printinfo = printinfo     printcontroller.printingitem = self.view.toimage() // toimage extension of uiview class      printcontroller.present(animated: true, completionhandler: {(_, isprinted, error) in         if error == nil {             if isprinted{                 print("it printed --------------------")             }else{                 print("it not printed ")             }         }else{             print("there error")         }      })  } 


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -