'Overlapping with CABasicAnimation Scaling
I have a collection view where the first cell needs to be animated with scaling. The standard cabasic animation's behaviour goes under neighbouring cell but I need to find a way so the scaling animation overlaps neighbouring cell. I've tried to put a clear view on a cell and animate it, so it would've been at the top of view hierarchy but it didn't help. Is there any assumptions how it can be achieved?
class func pulse(view: UIView, sizeMultiplier: Float, duration: TimeInterval, repeatCount: Float = 1.0) {
let pulseAnimation = CABasicAnimation(keyPath: "transform.scale")
pulseAnimation.duration = duration
pulseAnimation.toValue = NSNumber(value: sizeMultiplier)
pulseAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
pulseAnimation.autoreverses = true
pulseAnimation.repeatCount = repeatCount
view.layer.add(pulseAnimation, forKey: nil)
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|