Printing from UIActivityViewController

XCode 7.2 / MacOS 10.11.2 / targeting iOS 9.x / running in Simulator (iPhone 6s (9.2) )


I am a typical Sharing menu in my app using UIActivityViewController. The shared information is text from a UITextView.


  @IBAction func performShareAction(sender: UIBarButtonItem) {
       guard let activityVC = detailViewModel.buildActivityViewController() else {
            return
       }
       if UIDevice.currentDevice().userInterfaceIdiom == .Pad {
            activityVC.modalPresentationStyle = .Popover
            presentViewController(activityVC, animated: true, completion: nil)

            let popoverPresentationController = activityVC.popoverPresentationController
            popoverPresentationController?.barButtonItem = sender
       } else {
            presentViewController(activityVC, animated: true, completion: nil)
       }
  }

where the UIActivityViewController is created in the model-view using

     func buildActivityViewController() -> UIActivityViewController? {
          guard let textToShare = poem?.poem else {
            return nil
          }
          let attrs = [NSFontAttributeName: UIFont.systemFontOfSize(12)]
          let attributedText = NSAttributedString(string: textToShare, attributes: attrs)
          let print = UISimpleTextPrintFormatter(attributedText: attributedText)
          let objectsToShare = [textToShare, print]
          let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
          activityVC.excludedActivityTypes = [UIActivityTypeAddToReadingList, UIActivityTypeAssignToContact, UIActivityTypeOpenInIBooks]
          return activityVC
     }


This displays the standard activity view controller. I click Print and the appropriate print dialog appears. Printing works. But, I get the following console messages:

No print-quality-supported attribute found. Defaulting to normal quality.

Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x7fafab59c470>.

ColorQube\0328570DN\032(00:00:aa:f4:e5:f4)\032@\032Bianca._ipp._tcp.local.: Print-Job successful with warning: Job attributes did not match print document.

ColorQube\0328570DN\032(00:00:aa:f4:e5:f4)\032@\032Bianca._ipp._tcp.local.: Release-Job successful with warning: successful-ok (successful-ok)

Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<UIAlertController: 0x7fafacc6cb90>)


My question concerns the SECOND and LAST lines: am I doing something wrong here? or can I just safely ignore this?


Thanks,


Rick Aurbach

Printing from UIActivityViewController
 
 
Q