YBSlantedCollectionViewLayout 2.2.0

YBSlantedCollectionViewLayout 2.2.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2017
SwiftSwift Version 3.0.2
SPMSupports SPM

Maintained by Yassir Barchi.



Overview

YBSlantedCollectionViewLayout is a subclass of UICollectionViewLayout allowing the display of slanted content on UICollectionView.

Live Demo

YBSlantedCollectionViewLayout

Usage

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 to false
  • 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.

Apply the slanting mask

To apply the slanting mask on the cellView, use the YBSlantedCollectionViewCell or subclass it.

Roadmap

  • [x] Improve the attribution of the clic
  • [x] Carthage support
  • [x] Tests
  • [x] Swift 3 support
  • [x] Swift Package Manager support

Author

Yassir Barchi

Acknowledgement

This framework is inspired by this prototype released by Matt Bridges.

License

YBSlantedCollectionViewLayout is available under the MIT license. See the LICENSE file for more info.