Skip to content

Commit 325a3cb

Browse files
committedOct 16, 2015
Remove code and swiftier code.
1 parent 07972d7 commit 325a3cb

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed
 

‎CardAnimation/AnimatedCardView/AnimatedCardsView.swift

+2-24
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,7 @@ public class AnimatedCardsView: UIView {
136136
frontView.removeFromSuperview()
137137
self.relayoutSubViewsAnimated(true)
138138
})
139-
140139
}
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-
152140
}
153141

154142
// MARK: Card Generation
@@ -205,14 +193,8 @@ extension AnimatedCardsView {
205193
private func relayoutSubView(subView:UIView, relativeIndex:Int, animated:Bool = true, delay: NSTimeInterval = 0, haveBorderWidth: Bool = true, fadeAndDelete delete: Bool = false) {
206194
let width = Constants.DefaultSize.width
207195
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-
213196
subView.layer.zPosition = CGFloat(1000 - relativeIndex)
214197

215-
216198
var borderWidth: CGFloat = 0
217199
let filterSubViewConstraints = subView.constraints.filter({$0.firstAttribute == .Width && $0.secondItem == nil})
218200
if filterSubViewConstraints.count > 0{
@@ -232,12 +214,8 @@ extension AnimatedCardsView {
232214

233215
subView.layer.borderWidth = haveBorderWidth ? borderWidth : 0
234216

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)
241219
self.layoutIfNeeded()
242220
}, completion: { _ in
243221
if delete {

0 commit comments

Comments
 (0)