ios9 - AirPrint (UIPrintInteractionController) print warnings with iOS 9, swift 2, XCode 7 -
since updating newest xcode/swift 2/ios 9 keep getting warnings when trying use uiprintinteractioncontroller.
these warnings happen when have "print simulator" open. thought app made new single view app single uibutton simple code , still generates warnings. happens on both phone , ipad simulators
please help. it's driving me crazy, thank all
@ibaction func clicked(sender: anyobject) { let printcontroller = uiprintinteractioncontroller.sharedprintcontroller() let printinfo = uiprintinfo(dictionary:nil) printinfo.outputtype = uiprintinfooutputtype.general printinfo.jobname = "print job" printcontroller.printinfo = printinfo let formatter = uimarkuptextprintformatter(markuptext: "<b>hello world</b>") formatter.contentinsets = uiedgeinsets(top: 72, left: 72, bottom: 72, right: 72) printcontroller.printformatter = formatter if uidevice.currentdevice().userinterfaceidiom == .phone { printcontroller.presentanimated(false, completionhandler: nil) }else{ printcontroller.presentfromrect(view.frame, inview: view, animated: false, completionhandler: nil) } }
here warnings:
2015-09-29 18:58:19.748 myapp[1608:527574] unbalanced calls begin/end appearance transitions <uiviewcontroller: 0x13d5c6170>. 2015-09-29 18:58:20.013 myapp[1608:527574] behavior of uicollectionviewflowlayout not defined because: 2015-09-29 18:58:20.014 myapp[1608:527574] item height must less height of uicollectionview minus section insets top , bottom values, minus content insets top , bottom values. 2015-09-29 18:58:20.015 myapp[1608:527574] relevant uicollectionviewflowlayout instance <uicollectionviewflowlayout: 0x13d6a1e10>, , attached <uicollectionview: 0x13e063c00; frame = (0 0; 320 250); clipstobounds = yes; opaque = no; autoresize = w+h; gesturerecognizers = <nsarray: 0x13d5e7ef0>; layer = <calayer: 0x13d507850>; contentoffset: {0, 0}; contentsize: {0, 0}> collection view layout: <uicollectionviewflowlayout: 0x13d6a1e10>. 2015-09-29 18:58:20.015 myapp[1608:527574] make symbolic breakpoint @ uicollectionviewflowlayoutbreakforinvalidsizes catch in debugger. 2015-09-29 18:58:20.026 myapp[1608:527574] behavior of uicollectionviewflowlayout not defined because: 2015-09-29 18:58:20.026 myapp[1608:527574] item height must less height of uicollectionview minus section insets top , bottom values, minus content insets top , bottom values. 2015-09-29 18:58:20.027 myapp[1608:527574] relevant uicollectionviewflowlayout instance <uicollectionviewflowlayout: 0x13d6a1e10>, , attached <uicollectionview: 0x13e063c00; frame = (0 0; 320 250); clipstobounds = yes; opaque = no; autoresize = w+h; gesturerecognizers = <nsarray: 0x13d5e7ef0>; layer = <calayer: 0x13d507850>; contentoffset: {0, 0}; contentsize: {320, 250}> collection view layout: <uicollectionviewflowlayout: 0x13d6a1e10>. 2015-09-29 18:58:20.027 myapp[1608:527574] make symbolic breakpoint @ uicollectionviewflowlayoutbreakforinvalidsizes catch in debugger. 2015-09-29 18:58:21.735 myapp[1608:527574] behavior of uicollectionviewflowlayout not defined because: 2015-09-29 18:58:21.735 myapp[1608:527574] item height must less height of uicollectionview minus section insets top , bottom values, minus content insets top , bottom values. 2015-09-29 18:58:21.736 myapp[1608:527574] relevant uicollectionviewflowlayout instance <uicollectionviewflowlayout: 0x13d6ba990>, , attached <uicollectionview: 0x13e02c400; frame = (0 0; 320 250); clipstobounds = yes; opaque = no; autoresize = w+h; gesturerecognizers = <nsarray: 0x13d6809a0>; layer = <calayer: 0x13d6aa750>; contentoffset: {0, 0}; contentsize: {0, 0}> collection view layout: <uicollectionviewflowlayout: 0x13d6ba990>. 2015-09-29 18:58:21.736 myapp[1608:527574] make symbolic breakpoint @ uicollectionviewflowlayoutbreakforinvalidsizes catch in debugger. 2015-09-29 18:58:21.758 myapp[1608:527574] behavior of uicollectionviewflowlayout not defined because: 2015-09-29 18:58:21.759 myapp[1608:527574] item height must less height of uicollectionview minus section insets top , bottom values, minus content insets top , bottom values. 2015-09-29 18:58:21.759 myapp[1608:527574] relevant uicollectionviewflowlayout instance <uicollectionviewflowlayout: 0x13d6ba990>, , attached <uicollectionview: 0x13e02c400; frame = (0 0; 320 250); clipstobounds = yes; opaque = no; autoresize = w+h; gesturerecognizers = <nsarray: 0x13d6809a0>; layer = <calayer: 0x13d6aa750>; contentoffset: {0, 0}; contentsize: {320, 250}> collection view layout: <uicollectionviewflowlayout: 0x13d6ba990>. 2015-09-29 18:58:21.759 myapp[1608:527574] make symbolic breakpoint @ uicollectionviewflowlayoutbreakforinvalidsizes catch in debugger.
probably issue
printcontroller.presentfromrect(view.frame, inview: view, animated: false, completionhandler: nil)
verify view rect presentfromrect
or else try with
[printcontroller presentanimated:yes completionhandler:nil];
this solution removed warnings code, try luck.
Comments
Post a Comment