YBSlantedCollectionViewLayout is a subclass of UICollectionViewLayout allowing the display of slanted content on UICollectionView.
[Live Demo] (https://appetize.io/app/nd8vgwg0rkke19nmw3wzkapr5g)
<img src="https://cloud.githubusercontent.com/assets/2587473/13427516/d9af399e-dfb4-11e5-8109-ae997dc7c340.gif" alt="YBSlantedCollectionViewLayout" title="YBSlantedCollectionViewLayout">
YBSlantedCollectionViewLayout contains six properties to customize the interface.
var slantingDelta: UInt
var reverseSlantingAngle: Bool
var firstCellSlantingEnabled: Bool
var lastCellSlantingEnabled: Bool
var lineSpacing: CGFloat
var scrollDirection: UICollectionViewScrollDirection
var itemSizeOptions: YBSlantedCollectionViewLayoutSizeOptions
- slantingDelta is the slanting delta. Defaults to 50
- reverseSlantingAngle allows to reverse the slanting angle if the value is
true
. By default, this property is set tofalse
- firstCellSlantingEnabled allows to enable the slanting for the first cell. By default, this property is set to
true
- lastCellSlantingEnabled allows to enable the slanting for the last cell. By default, this property is set to
true
- lineSpacing is the spacing to use between two items. Defaults to 10.0
- scrollDirection is the scroll direction. Defaults to
UICollectionViewScrollDirectionVertical
- itemSizeOptions allows to set the item's width/height depending on the scroll direction.
To apply the slanting mask on the cellView, use the YBSlantedCollectionViewCell
or subclass it.
YBSlantedCollectionViewLayout is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "YBSlantedCollectionViewLayout", '~> 2.1'
You can also install it via Carthage. To do so, add the following to your Cartfile:
github 'yacir/YBSlantedCollectionViewLayout'
- Improve the attribution of the clic
- Carthage support
- Tests
This framework is inspired by this prototype released by Matt Bridges.
YBSlantedCollectionViewLayout is available under the MIT license. See the LICENSE file for more info.