I have seen a similar question asked here about creating collection views programmatically but not with IB or nibs or xibs or whatever I am supposed to call it.
Its my understanding that when using a XIB the objects inside the XIB get instantiated automatically by IB. Therefore, it makes sense that for another collectionView I am creating with a XIB it works without programmatically instantiating a flow layout object. However, this second view is crashing with the error:
'NSInvalidArgumentException', reason: 'UICollectionView must be initialized with a non-nil layout parameter'
My first thought was to alloc/init a new flow layout and add it to the collectionViews layout object as in self.collectionView.collectionViewLayout = newLayout
. (I'm in a collection View Controller). However, this property seems to be read-only. Because I'm using a XIB I assume xcode is somehow doing the layout behind the scenes but that doesn't help with figuring out whats going wrong.