Commit 159165b9 by Daniel Dahan

development: added a Divider object to a CollectionViewCell

parent 53a2c6ce
...@@ -121,6 +121,6 @@ open class CollectionView: UICollectionView { ...@@ -121,6 +121,6 @@ open class CollectionView: UICollectionView {
open func prepareView() { open func prepareView() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
backgroundColor = Color.clear backgroundColor = Color.clear
contentInset = UIEdgeInsets.zero contentInset = .zero
} }
} }
...@@ -33,6 +33,9 @@ import UIKit ...@@ -33,6 +33,9 @@ import UIKit
@IBDesignable @IBDesignable
@objc(CollectionViewCell) @objc(CollectionViewCell)
open class CollectionViewCell: UICollectionViewCell { open class CollectionViewCell: UICollectionViewCell {
/// A reference to the divider.
open internal(set) var divider: Divider!
/** /**
A CAShapeLayer used to manage elements that would be affected by A CAShapeLayer used to manage elements that would be affected by
the clipToBounds property of the backing layer. For example, this the clipToBounds property of the backing layer. For example, this
...@@ -274,6 +277,7 @@ open class CollectionViewCell: UICollectionViewCell { ...@@ -274,6 +277,7 @@ open class CollectionViewCell: UICollectionViewCell {
open func prepareView() { open func prepareView() {
contentScaleFactor = Device.scale contentScaleFactor = Device.scale
prepareVisualLayer() prepareVisualLayer()
prepareDivider()
} }
/// Prepares the visualLayer property. /// Prepares the visualLayer property.
...@@ -289,4 +293,9 @@ open class CollectionViewCell: UICollectionViewCell { ...@@ -289,4 +293,9 @@ open class CollectionViewCell: UICollectionViewCell {
visualLayer.frame = bounds visualLayer.frame = bounds
visualLayer.cornerRadius = cornerRadius visualLayer.cornerRadius = cornerRadius
} }
/// Prepares the divider.
private func prepareDivider() {
divider = Divider(view: self)
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment