@@ -49,7 +49,7 @@ class SDEPushAndPopAnimationController: NSObject, UIViewControllerAnimatedTransi
49
49
50
50
let layoutAttributes = fromVC!. collectionView? . layoutAttributesForItemAtIndexPath ( fromVC!. selectedIndexPath)
51
51
let areaRect = fromVC!. collectionView? . convertRect ( layoutAttributes!. frame, toView: fromVC!. collectionView? . superview)
52
- toVC!. areaRectInSuperview = areaRect!
52
+ toVC!. coverRectInSuperview = areaRect!
53
53
54
54
//key code, the most important code here. without this line, you can't get visibleCells from UICollectionView.
55
55
//And, there are other ways, Just make view redraw.
@@ -113,7 +113,7 @@ class SDEPushAndPopAnimationController: NSObject, UIViewControllerAnimatedTransi
113
113
coverContainerView. tag = 1000
114
114
115
115
toVC. view. addSubview ( coverContainerView)
116
- coverContainerView. frame = toVC. areaRectInSuperview
116
+ coverContainerView. frame = toVC. coverRectInSuperview
117
117
118
118
let frame = coverContainerView. frame
119
119
coverContainerView. layer. anchorPoint = CGPointMake ( 0 , 0.5 )
@@ -187,7 +187,7 @@ class SDEPushAndPopAnimationController: NSObject, UIViewControllerAnimatedTransi
187
187
private func setupVisibleCellsBeforePushToVC( toVC: UICollectionViewController ) {
188
188
if toVC. collectionView? . visibleCells ( ) . count > 0 {
189
189
190
- let areaRect = toVC. collectionView!. convertRect ( toVC. areaRectInSuperview , fromView: toVC. collectionView!. superview)
190
+ let areaRect = toVC. collectionView!. convertRect ( toVC. coverRectInSuperview , fromView: toVC. collectionView!. superview)
191
191
let cellsAreaRect = UIEdgeInsetsInsetRect ( areaRect, coverEdgeInSets)
192
192
193
193
let cellWidth = ( cellsAreaRect. width - CGFloat( horizontalCount - 1 ) * horizontalGap) / CGFloat( horizontalCount)
@@ -249,7 +249,7 @@ class SDEPushAndPopAnimationController: NSObject, UIViewControllerAnimatedTransi
249
249
let minimalRow = rows. reduce ( Int . max, combine: { $0 < $1 ? $0 : $1 } )
250
250
251
251
let collectionView = fromVC. collectionView!
252
- let areaRect = collectionView. convertRect ( fromVC. areaRectInSuperview , fromView: fromVC. collectionView!. superview)
252
+ let areaRect = collectionView. convertRect ( fromVC. coverRectInSuperview , fromView: fromVC. collectionView!. superview)
253
253
let cellsAreaRect = UIEdgeInsetsInsetRect ( areaRect, coverEdgeInSets)
254
254
255
255
let cellWidth = ( cellsAreaRect. width - CGFloat( horizontalCount - 1 ) * horizontalGap) / CGFloat( horizontalCount)
0 commit comments