Skip to content

Commit 87908ad

Browse files
committed
remove an unnecessary propertie
1 parent 102879a commit 87908ad

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Sources/CollectionViewSlantedCell.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@ import UIKit
3030
*/
3131
@objc open class CollectionViewSlantedCell: UICollectionViewCell {
3232

33-
/// :nodoc:
34-
fileprivate var slantedLayerMask: CAShapeLayer?
35-
3633
/// :nodoc:
3734
override open func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
38-
guard let mask = slantedLayerMask else {
35+
guard let mask = layer.mask as? CAShapeLayer, let path = mask.path else {
3936
return super.point(inside: point, with: event)
4037
}
4138

4239
let bezierPath = UIBezierPath()
43-
bezierPath.cgPath = mask.path!
40+
bezierPath.cgPath = path
4441
let result = bezierPath.contains(point)
4542
return result
4643
}
@@ -51,7 +48,6 @@ import UIKit
5148
guard let layoutAttributes = layoutAttributes as? CollectionViewSlantedLayoutAttributes else {
5249
return
5350
}
54-
slantedLayerMask = layoutAttributes.slantedLayerMask
5551
layer.mask = layoutAttributes.slantedLayerMask
5652
}
5753

0 commit comments

Comments
 (0)