我必須在橫向模式下發送Airprint我的WebView。 但是在設置我的方向時出現錯誤。 我寫了這個代碼如何將Airprint方向設置爲快速橫向顯示?
let printcontroller = UIPrintInteractionController.sharedPrintController()
let printinfo = UIPrintInfo(dictionary:nil)
printinfo.jobName = "Printing Label"
printinfo.outputType = UIPrintInfoOutputType.General
printcontroller.printInfo = printinfo
printinfo.orientation = UIDeviceOrientationLandscapeRight
printcontroller.printFormatter = myWeb.viewPrintFormatter()
printcontroller.showsNumberOfCopies = false
printcontroller.presentAnimated(true) { (_, isPrinted, error) in
if error == nil
{
if isPrinted
{
print ("Printed Successfully")
} else
{
print ("Printing failed")
}
}
}
self.performSegueWithIdentifier("finaltohome", sender: nil)
請幫助我。