Customising position of header in UICollectionView layout causes NSInternalInconsistencyException error
问题 I am trying to customise the positions of the headers in a UICollectionView using a subclassed UICollectionViewFlowLayout class (based loosely on the code for stacked headers which is shown enter link description here). As a minimal test, let's say I just want to add a fixed offset to the position of all headers: I add all headers to the array returned by layoutAttributesForElementsInRect so that all are always processed (this may be the cause of the problem, I'm not sure) I then update each