🚀 Awesome Animation Concepts
Slider 🎡: Personalized slider featuring images gracefully dispersing in various directions.
Gravity 🌌: Animated Xcode ascending a pedestal, triumphing over buildFailed challenges.
Thunder + Rain âš¡: Simulated rain and thunder effects.
DrawHearts 💖: Endearing depiction of a hand-drawn heart.
GradientButton 🌟: Smooth color transitions within the shape.
Exclusively crafted using UIKit; no additional frameworks needed. Enjoy the showcase! 🎉✨
Gravity.mp4
private var animator: UIDynamicAnimator?
private var behavior: UICollisionBehavior?
Use UIDynamicAnimator
and UICollisionBehavior
for dynamic animations and collision handling.
TableView.mp4
Use CAEmitterCell
and CAEmitterLayer
to create animated particles.
let emitterLayer = CAEmitterLayer()
let cell = CAEmitterCell()
thunderAndRain.mp4
The part of code:
private var thunderstormLayer = CAEmitterLayer()
private var rainCell = CAEmitterCell()
private var lightningCell = CAEmitterCell()
private var lightningLayer = CAEmitterLayer()
// Configure rain emitter cell properties
rainCell.birthRate = 150
rainCell.lifetime = 6
rainCell.velocity = 500
rainCell.velocityRange = 50
rainCell.emissionLongitude = .pi
rainCell.emissionRange = .pi / 10
rainCell.spin = 1.5
rainCell.spinRange = 0.9
rainCell.scale = 0.005
rainCell.scaleRange = 0.05
rainCell.contents = UIImage(named: Constant.particles)?.cgImage
DrawHeart.mp4
Use UIBezierPath
and CABasicAnimation
to draw and animate it
let path = UIBezierPath()
let drawAnimation = CABasicAnimation(keyPath: "strokeEnd")
gradientButton.mp4
Use CAKeyframeAnimation
and CABasicAnimation
to animate shadow and changing color
let colorAnimation = CAKeyframeAnimation(keyPath: "shadowColor")
let gradientAnimation = CABasicAnimation(keyPath: "colors")