最新の XCode/Swift 2/iOS 9 に更新してから、UIPrintInteractionController を使用しようとすると警告が表示され続けます。
これらの警告は、「印刷シミュレーター」を開いたときにのみ発生します。私はそれが私のアプリだと思ったので、非常に単純なコードを実行する単一の UIButton を備えた新しい単一ビュー アプリを作成しましたが、それでも警告が生成されます。電話とiPadの両方のシミュレーターで発生します
助けてください。それは私を夢中にさせています、ありがとうございます
@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)
}
}
警告は次のとおりです。
2015-09-29 18:58:19.748 MyApp[1608:527574] Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x13d5c6170>.
2015-09-29 18:58:20.013 MyApp[1608:527574] the behavior of the UICollectionViewFlowLayout is not defined because:
2015-09-29 18:58:20.014 MyApp[1608:527574] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2015-09-29 18:58:20.015 MyApp[1608:527574] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x13d6a1e10>, and it is attached to <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 a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2015-09-29 18:58:20.026 MyApp[1608:527574] the behavior of the UICollectionViewFlowLayout is not defined because:
2015-09-29 18:58:20.026 MyApp[1608:527574] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2015-09-29 18:58:20.027 MyApp[1608:527574] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x13d6a1e10>, and it is attached to <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 a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2015-09-29 18:58:21.735 MyApp[1608:527574] the behavior of the UICollectionViewFlowLayout is not defined because:
2015-09-29 18:58:21.735 MyApp[1608:527574] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2015-09-29 18:58:21.736 MyApp[1608:527574] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x13d6ba990>, and it is attached to <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 a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2015-09-29 18:58:21.758 MyApp[1608:527574] the behavior of the UICollectionViewFlowLayout is not defined because:
2015-09-29 18:58:21.759 MyApp[1608:527574] the item height must be less than the height of the UICollectionView minus the section insets top and bottom values, minus the content insets top and bottom values.
2015-09-29 18:58:21.759 MyApp[1608:527574] The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x13d6ba990>, and it is attached to <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 a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.