Well, I already answered my first question: UICollectionViewControllerWrapperView has an ivar called _subviewCache , which is a mutable array containing the actual UICollectionView at index 0. Weird.
However, I would still like the answer to my second question. It seems to me that the collection view controller does not support a strong reference to the original layout, because its collectionViewLayout (initial layout) property is readonly, and I canβt find the link to the collection view layout when checking the collection view controller in the debugger variables view. However, if so, then how is it held on to the original layout even after the collection view has been replaced by a strong link to the original layout from a strong link to another layout?
Update: It turns out that the bad access crash that I saw was caused by a slightly different issue related to the ownership of the UIDynamicAnimator layout. This is almost certainly an error in the Apple code, and I filed a radar that you can read here (duplication is welcome!):
http://www.openradar.me/15062440
However, none of these questions concern my second question. This does not apply either to me or to my work, but I still welcome and support any real answers, even if they are purely academic at this moment.
source share