I want to invalidateLayout() of the custom UICollectionView when the bounds are changed. I know that I can call this method from the controller using viewWillLayoutSubviews(). But since I want to make this custom UICollectionView as a framework, I want to implement the function without being dependent to the controller.
If I try to invalidateLayout() inside override open func layoutSubviews() then I get an infinite loop.
What is the best way to implement what I want with the constraints give?