Data Driven Custom UICollectionView Layouts sometimes Doesn't update after reloadData() is called

I have designed an UICollectionView with CustomLayout. The layout depends on the data. Whenever a new data pattern is appeared we update the data and call the UICollectionView reload data. But sometimes I found that although the data is updated, The layout remains unchanged.

Data Driven Custom UICollectionView Layouts sometimes Doesn't update after reloadData() is called
 
 
Q