• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
UIPrintInteractionController failure on iOS 9.3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UIPrintInteractionController failure on iOS 9.3


  • Subject: UIPrintInteractionController failure on iOS 9.3
  • From: Luca Ciciriello <email@hidden>
  • Date: Mon, 25 Apr 2016 11:59:48 +0200

Hi All.
In my app I’ve a method used to print some text on a printer. 

My code is 

let printController = UIPrintInteractionController.sharedPrintController()

        

        let printInfo = UIPrintInfo(dictionary:nil)
        printInfo.outputType = UIPrintInfoOutputType.General
        printInfo.jobName = "note"
        printController.printInfo = printInfo

        

        func textFormatter(text: String) -> String
        {
            return text.stringByReplacingOccurrencesOfString("\n", withString: "<BR>")
        }

        

        let formatter = UIMarkupTextPrintFormatter(markupText: textFormatter(self.testo.text))
        formatter.contentInsets = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)
        printController.printFormatter = formatter

        

        if UIDevice.currentDevice().userInterfaceIdiom == .Pad
        {
            printController.presentFromRect(self.printBtn.frame, inView:self.view, animated:true, completionHandler: nil)
        }
        else
        {
            printController.presentAnimated(true, completionHandler: nil)
        }

This code works properly in iOS 8.3 but my app crash in iOS 9.3 when in the code above I call

printController.presentFromRect(self.printBtn.frame, inView:self.view, animated:true, completionHandler: nil)

I’ve noticed that the app doesn’t crash if the self.testo.text is an empty string. This behaviour is the same on the simulator and on a real device. 

Where is my mistake? Any Idea?

Regards 

Luca.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: missing man pages
  • Next by Date: Radio buttons as table views
  • Previous by thread: Re: Core Data with Xcode 7.3
  • Next by thread: Re: UIPrintInteractionController failure on iOS 9.3
  • Index(es):
    • Date
    • Thread