@@ -136,19 +136,7 @@ public class AnimatedCardsView: UIView {
136
136
frontView. removeFromSuperview ( )
137
137
self . relayoutSubViewsAnimated ( true )
138
138
} )
139
-
140
139
}
141
-
142
- // //MARK: Handle Screen Rotation
143
- // override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
144
- // super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
145
- // coordinator.animateAlongsideTransition({
146
- // _ in
147
- // self.gradientBackgroundLayer.frame = self.view.bounds
148
- // self.relayoutSubViews()
149
- // }, completion: nil)
150
- // }
151
-
152
140
}
153
141
154
142
// MARK: Card Generation
@@ -205,14 +193,8 @@ extension AnimatedCardsView {
205
193
private func relayoutSubView( subView: UIView , relativeIndex: Int , animated: Bool = true , delay: NSTimeInterval = 0 , haveBorderWidth: Bool = true , fadeAndDelete delete: Bool = false ) {
206
194
let width = Constants . DefaultSize. width
207
195
subView. layer. anchorPoint = CGPointMake ( 0.5 , 1 )
208
-
209
- // if let nestedImageView = subView.viewWithTag(10) as? UIImageView{
210
- // nestedImageView.image = cardImageAtIndex(viewTag - 1)
211
- // }
212
-
213
196
subView. layer. zPosition = CGFloat ( 1000 - relativeIndex)
214
197
215
-
216
198
var borderWidth : CGFloat = 0
217
199
let filterSubViewConstraints = subView. constraints. filter ( { $0. firstAttribute == . Width && $0. secondItem == nil } )
218
200
if filterSubViewConstraints. count > 0 {
@@ -232,12 +214,8 @@ extension AnimatedCardsView {
232
214
233
215
subView. layer. borderWidth = haveBorderWidth ? borderWidth : 0
234
216
235
- UIView . animateWithDuration ( animated ? animationsSpeed : 0 , delay: delay, options: UIViewAnimationOptions . BeginFromCurrentState, animations: {
236
- if delete {
237
- subView. alpha = 0
238
- } else {
239
- subView. alpha = self . calculateAlphaForIndex ( relativeIndex)
240
- }
217
+ UIView . animateWithDuration ( animated ? animationsSpeed : 0 , delay: delay, options: . BeginFromCurrentState, animations: {
218
+ subView. alpha = delete ? 0 : self . calculateAlphaForIndex ( relativeIndex)
241
219
self . layoutIfNeeded ( )
242
220
} , completion: { _ in
243
221
if delete {
0 commit comments