An easy to use Collection View Layout for card-like animation 🎉
CarLensCollectionViewLayout was created out of the implementation in CarLens application 🚘. The image above exactly shows the screen from the app!
CarLensCollectionViewLayout is written in Swift 4.2 and supports iOS 9.0+.
The two main steps are needed for the configuration of CarLensCollectionViewLayout:
Assign CarLensCollectionViewLayout
to yours collection view layout:
collectionView.collectionViewLayout = CarLensCollectionViewLayout()
or initialize your collection view with CarLensCollectionViewLayout
:
UICollectionView(frame: .zero, collectionViewLayout: CarLensCollectionViewLayout())
Subsclass CarLensCollectionViewCell
and call configure(topView: UIView, cardView: UIView)
right on the start!
class CollectionViewCell: CarLensCollectionViewCell {
override init(frame: CGRect) {
super.init(frame: frame)
configure(topView: upperView, cardView: bottomView)
}
}
The sample implementation is available in Demo project.
If you're using CocoaPods, add the following dependency to your Podfile
:
use_frameworks!
pod 'CarLensCollectionViewLayout', '~> 1.0.0'
If you're using Carthage, add the following dependency to your Cartfile
:
github "netguru/CarLensCollectionViewLayout" ~> 1.0.0
This project is made with ❤️ by Netguru.
CarLensCollectionViewLayout is licensed under the MIT License. See LICENSE.md for more info.