CollectionViewSlantedLayout
@objc
open class CollectionViewSlantedLayout : UICollectionViewLayout
CollectionViewSlantedLayout is a subclass of UICollectionViewLayout allowing the display of slanted content on UICollectionView.
By default, this UICollectionViewLayout has initialize a set of properties to work as designed.
-
The slanting size.
The default value of this property is
75
.Declaration
Swift
@IBInspectable open var slantingSize: UInt { get set }
-
The slanting direction.
The default value of this property is
upward
.Declaration
Swift
@objc open var slantingDirection: SlantingDirection { get set }
-
The angle, in radians, of the slanting.
The value of this property could be used to apply a rotation transform on the cell’s contentView in the
collectionView(_:cellForItemAt:)
method implementation.if let layout = collectionView.collectionViewLayout as? CollectionViewSlantedLayout { cell.contentView.transform = CGAffineTransform(rotationAngle: layout.rotationAngle) }
Declaration
Swift
@objc open fileprivate(set) var slantingAngle: CGFloat
-
The scroll direction of the grid.
The grid layout scrolls along one axis only, either horizontally or vertically. The default value of this property is
vertical
.Declaration
Swift
@objc open var scrollDirection: UICollectionView.ScrollDirection { get set }
-
Allows to disable the slanting for the first cell.
Set it to
true
to disable the slanting for the first cell. The default value of this property isfalse
.Declaration
Swift
@IBInspectable open var isFirstCellExcluded: Bool { get set }
-
Allows to disable the slanting for the last cell.
Set it to
true
to disable the slanting for the last cell. The default value of this property isfalse
.Declaration
Swift
@IBInspectable open var isLastCellExcluded: Bool { get set }
-
The spacing to use between two items.
The default value of this property is 10.0.
Declaration
Swift
@IBInspectable open var lineSpacing: CGFloat { get set }
-
The default size to use for cells.
If the delegate does not implement the
collectionView(_:layout:sizeForItemAt:)
method, the slanted layout uses the value in this property to set the size of each cell. This results in cells that all have the same size.The default value of this property is 225.
Declaration
Swift
@IBInspectable open var itemSize: CGFloat { get set }
-
The zIndex order of the items in the layout.
The default value of this property is
ascending
.Declaration
Swift
@objc open var zIndexOrder: ZIndexOrder { get set }