UISplitViewController .sidebar appearance: 'Unknown style: 10'

I updated to beta 4 and started getting this error when I try to apply the .sidebar appearance to the primary view of a UISplitViewController.

To replicate this issue I modified the 'Modern Collection Views' sample code to use a UISplitViewController and set the primary view to be the sample code.

As soon as the primary view becomes visible, the app crashes with this error

Code Block language
2020-08-05 08:34:36.582560-0500 Modern Collection Views[38363:6217715] * Assertion failure in -[UIListContentConfiguration _enforcesMinimumHeight], UIListContentConfiguration.m:470
2020-08-05 08:34:36.605817-0500 Modern Collection Views[38363:6217715] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unknown style: 10'
* First throw call stack:
(
0  CoreFoundation           0x00007fff20438fda exceptionPreprocess + 242
1  libobjc.A.dylib           0x00007fff2017712e objc_exception_throw + 48
2  CoreFoundation           0x00007fff20438e03 +[NSException raise:format:] + 0
3  Foundation             0x00007fff20785e3a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
4  UIKitCore              0x00007fff24782071 -[UIListContentView _intrinsicSizeWithinSize:] + 600
5  UIKitCore              0x00007fff2478128b -[UIListContentView systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 107
6  UIKitCore              0x00007fff23d27d81 -[UICollectionViewCell systemLayoutSizeFittingSize:withHorizontalFittingPriority:verticalFittingPriority:] + 310
7  UIKitCore              0x00007fff23d23950 -[UICollectionReusableView preferredLayoutAttributesFittingAttributes:] + 392
8  UIKitCore              0x00007fff23d233af -[UICollectionReusableView _preferredLayoutAttributesFittingAttributes:] + 65
9  UIKitCore              0x00007fff23cbba01 -[UICollectionViewListCell _preferredLayoutAttributesFittingAttributes:] + 168
10 UIKitCore              0x00007fff23ce998a -[UICollectionView _checkForPreferredAttributesInView:originalAttributes:] + 557
11 UIKitCore              0x00007fff23cea626 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:notify:] + 879
12 UIKitCore              0x00007fff23cea2b1 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 31
13 UIKitCore              0x00007fff23cef8e9 -[UICollectionView _updateVisibleCellsNow:] + 6166
14 UIKitCore              0x00007fff23cf4aad -[UICollectionView layoutSubviews] + 351
15 UIKitCore              0x00007fff24b4d822 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2874
16 QuartzCore             0x00007fff27a1c60f -[CALayer layoutSublayers] + 258
17 QuartzCore             0x00007fff27a22ac1 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 575
18 UIKitCore              0x00007fff24b38f8c -[UIView(Hierarchy) layoutBelowIfNeeded] + 573
19 UIKitCore              0x00007fff24b4041d +[UIView(Animation) performWithoutAnimation:] + 84
20 UIKitCore              0x00007fff23e7759b -[UIPanelController _animateFromRequest:toRequest:withAffectedSides:forceOverlay:velocity:] + 1936
21 UIKitCore              0x00007fff23e78173 -[UIPanelController animateToRequest:forceOverlay:withVelocity:] + 611
22 UIKitCore              0x00007fff23ea7dfa -[UISplitViewControllerPanelImpl _transitionFromDisplayMode:toDisplayMode:] + 1100
23 UIKitCore              0x00007fff23eb81ea -[UISplitViewControllerPanelImpl _triggerDisplayModeAction:] + 195
24 UIKitCore              0x00007fff245fc19a -[UIApplication sendAction:to:from:forEvent:] + 83
25 UIKitCore              0x00007fff23b400cd -[UIBarButtonItem _triggerActionForEvent:] + 158
26 UIKitCore              0x00007fff23b885d2 64-[_UINavigationBarContentView _setupStaticNavBarButtonAnimated:]_block_invoke.182 + 36
27 UIKitCore              0x00007fff2451901e -[UIAction _performActionWithSender:] + 75
28 UIKitCore              0x00007fff23f2fd2b -[UIControl _sendActionsForEvents:withEvent:] + 284
29 UIKitCore              0x00007fff23f2e644 -[UIControl touchesEnded:withEvent:] + 500
30 UIKitCore              0x00007fff24638a8a -[UIWindow _sendTouchesForEvent:] + 1287
31 UIKitCore              0x00007fff2463a903 -[UIWindow sendEvent:] + 4774
32 UIKitCore              0x00007fff24614366 -[UIApplication sendEvent:] + 633
33 UIKitCore              0x00007fff246a50e9 processEventQueue + 17086
34 UIKitCore              0x00007fff2469ae08 eventFetcherSourceCallback + 104
35 CoreFoundation           0x00007fff203a7607 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
36 CoreFoundation           0x00007fff203a74ff CFRunLoopDoSource0 + 180
37 CoreFoundation           0x00007fff203a69e1 CFRunLoopDoSources0 + 248
38 CoreFoundation           0x00007fff203a11b9 CFRunLoopRun + 878
39 CoreFoundation           0x00007fff203a0960 CFRunLoopRunSpecific + 567
40 GraphicsServices          0x00007fff2b9e7db3 GSEventRunModal + 139
41 UIKitCore              0x00007fff245f5bd9 -[UIApplication _run] + 912
42 UIKitCore              0x00007fff245faaea UIApplicationMain + 101
43 Modern Collection Views       0x000000010150247b main + 75
44 libdyld.dylib            0x00007fff20256431 start + 1
)
libcabi.dylib: terminating with uncaught exception of type NSException
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unknown style: 10'
terminating with uncaught exception of type NSException
CoreSimulator 732.10 - Device: iPad Pro (11-inch) (2nd generation) (AEA64DAA-6467-4B67-8CE7-F03BF6770045) - Runtime: iOS 14.0 (18A5342e) - DeviceType: iPad Pro (11-inch) (2nd generation)


Answered by Frameworks Engineer in 629268022
This issue has been resolved in iOS 14 beta 6 released today. Please remove any workarounds and give it a try.
I get the same 'Unknown style: 10' crash in my UISplitViewController-based app (with sidebar) after upgrading my iPad to beta 4. Doesn't depend on the Xcode version, happens with Xcode 12 beta 3 as well as beta 4.
Workaround from @JPEGuin on Twitter: use 'var content = UIListContentConfiguration.sidebarCell()' instead of defaultContentConfiguration().
This is still happening in beta 5 for me
Test on beta 5, they fixed issues for UISplitViewController.


Resolved
UISplitViewController instances in Interface Builder again use the Unspecified style by default, unless they have a supplementary view controller connected. To take advantage of iOS 14 improvements, select Double Column from the Style menu in the inspector. (65966010) (FB8107534)


This is a known issue in iOS 14 beta 4 and 5. The crash happens when you try to use the accompaniedSidebarCell or accompaniedSidebarSubtitleCell styles for UIListContentConfiguration that were added in iOS 14 beta 4. These styles are the default ones returned from the defaultContentConfiguration() method of a list cell inside a list with .sidebar appearance contained in the primary column of a .tripleColumn UISplitViewController.

Until this is fixed in the next beta, you can work around the crash by using UIListContentConfiguration.sidebarCell() instead, however make sure to remove that workaround once the underlying issue is fixed so that your cell content gets the correct styling.
Accepted Answer
This issue has been resolved in iOS 14 beta 6 released today. Please remove any workarounds and give it a try.
UISplitViewController .sidebar appearance: 'Unknown style: 10'
 
 
Q