How to make carousel layout for UICollectionView in iOS
Issue #302 Based on AnimatedCollectionViewLayout final class CarouselLayout: UICollectionViewFlowLayout { override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? { guard let attributes = super.layoutAttributesForElements(in: rect) else { return nil } guard let collectionView = collectionView else { return nil } return attributes.map({ transform(collectionView: collectionView, attribute: $0) }) } override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool { return true } private func transform(collectionView: UICollectionView, attribute: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes { let a = attribute let width = collectionView....