iOS15 collectionViewContentSize Error

I am using UICollectionViewFlowLayout for CollectionView for chat rooms as a newly inherited CustomClass.

Before upgrading to iOS15, there was no problem a value of zero or more when I override the collectionViewContentSize.

However, If a non-zero value is given after the upgrade, the following error occurs.

override var collectionViewContentSize: CGSize {
    get {
        if 
            return CGSize(width: 10, height: 10) => Error
        else
            return .zero => No Error
    }
}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView is stuck in its update/layout loop. This can happen for many reasons, including self-sizing views whose preferred attributes are not returning a consistent size. To debug this issue, check the Console app for logs in the "UICollectionViewRecursion" category.'
terminating with uncaught exception of type NSException

how can i fix it?

Same here. The error occurs frequently on iPads (iPadOS 15).

same issue, @Nudgest did you able to resolve it?

iOS15 collectionViewContentSize Error
 
 
Q