We also have Crashes (with variations) with UIActivityViewController. The problem is, that we can reproduce it, but don't know how to fix it. Maybe it's a problem of share sheet. The other problem is, that the crash varies depending on the device and iOS version.
We can reproduce a variation with iOS Simulator "iPad Pro (9.7-inch) iOS 16.4".
PDF share with UIActivityViewController
print
Layout -> change pages per sheet multiple times (fast) -> app crashes
Let me know if you've found a solution.
*** Assertion failure in -[UICollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Number_Of_Items_In_Section:], UICollectionView.m:10074
** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (5) must be equal to the number of items contained in that section before the update (3), plus or minus the number of items inserted or deleted from that section (3 inserted, 3 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out). Collection view: <UICollectionView: 0x14196ea00; frame = (0 56; 235 888); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x6000000f08d0>; backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x600000a32200>; contentOffset: {0, 0}; contentSize: {235, 968}; adjustedContentInset: {0, 0, 0, 0}; layout: <UIPrintPreviewFlowLayout: 0x2ad32d040>; dataSource: <UIPrintPreviewViewController: 0x14196aa00>>'
*** First throw call stack:
(
0 CoreFoundation 0x0000000106c1a330 __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00000001059bd274 objc_exception_throw + 56
2 Foundation 0x0000000107cb89b4 _userInfoForFileAndLine + 0
3 UIKitCore 0x000000011a59a24c -[UICollectionView _Bug_Detected_In_Client_Of_UICollectionView_Invalid_Number_Of_Items_In_Section:] + 92
4 UIKitCore 0x000000011a599cfc -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] + 10048
5 UIKitCore 0x000000011a596a3c -[UICollectionView _updateRowsAtIndexPaths:updateAction:updates:] + 360
6 UIKitCore 0x000000011a596b70 -[UICollectionView reloadItemsAtIndexPaths:] + 48
7 UIKit 0x00000001473efcd8 -[UICollectionViewAccessibility reloadItemsAtIndexPaths:] + 48
8 PrintKitUI 0x000000010c97a2d4 __55-[UIPrintPreviewViewController updatePrintPreviewInfo:]_block_invoke_3 + 76
9 UIKitCore 0x000000011b228138 +[UIView(Animation) performWithoutAnimation:] + 68
10 PrintKitUI 0x000000010c97a238 __55-[UIPrintPreviewViewController updatePrintPreviewInfo:]_block_invoke + 520
11 PrintKitUI 0x000000010c9a7b68 -[UIPrintPreviewPageFetcher resetAllPages:] + 48
12 PrintKitUI 0x000000010c97a00c -[UIPrintPreviewViewController updatePrintPreviewInfo:] + 116
13 PrintKitUI 0x000000010c998f48 -[UIPrintPanelViewController updatePrintPreviewInfo] + 68
14 PrintKitUI 0x000000010c9971f4 -[UIPrintPanelViewController observeValueForKeyPath:ofObject:change:context:] + 312
15 Foundation 0x0000000107d04f1c NSKeyValueNotifyObserver + 248
16 Foundation 0x0000000107d07e98 NSKeyValueDidChange + 352
17 Foundation 0x0000000107d0786c -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] + 644
18 Foundation 0x0000000107d08064 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 60
19 Foundation 0x0000000107d0168c _NSSetObjectValueAndNotify + 256
20 PrintKitUI 0x000000010c989c14 -[UIPrintPagesPerSheetOption listItemSelected:] + 276
21 PrintKitUI 0x000000010c96ce0c -[UIPrintOptionListViewController tableView:didSelectRowAtIndexPath:] + 112
22 UIKitCore 0x000000011af622b8 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:isCellMultiSelect:deselectPrevious:performCustomSelectionAction:] + 1208
23 UIKitCore 0x000000011af625c8 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 252
24 UIKitCore 0x000000011b1dd9e8 -[_UIAfterCACommitBlock run] + 64
25 UIKitCore 0x000000011b1dde14 -[_UIAfterCACommitQueue flush] + 164
26 UIKitCore 0x000000011ad9bce8 _runAfterCACommitDeferredBlocks + 492
27 UIKitCore 0x000000011ad8da6c _cleanUpAfterCAFlushAndRunDeferredBlocks + 104
28 UIKitCore 0x000000011adb7d50 _afterCACommitHandler + 60
29 CoreFoundation 0x0000000106b7cc10 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
30 CoreFoundation 0x0000000106b7757c __CFRunLoopDoObservers + 512
31 CoreFoundation 0x0000000106b77a20 __CFRunLoopRun + 948
32 CoreFoundation 0x0000000106b77254 CFRunLoopRunSpecific + 584
33 GraphicsServices 0x000000010d11fc9c GSEventRunModal + 160
34 UIKitCore 0x000000011ad8eff0 -[UIApplication _run] + 868
35 UIKitCore 0x000000011ad92f3c UIApplicationMain + 124