setCollectionViewLayout(_:animated:)
Changes the collection view’s layout and optionally animates the change.
Declaration
func setCollectionViewLayout(_ layout: UICollectionViewLayout, animated: Bool)Parameters
Discussion
This method makes the layout change without further interaction from the user. If you choose to animate the layout change, the animation timing and parameters are controlled by the collection view.