我必须在横向模式下发送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)
请帮助我。