🇺🇸 English |
🇹🇷 Türkçe
🏆 What Makes This Library #1?
Feature
This Library
Lottie
Built-in SwiftUI
Animations
50+ ready-to-use
JSON only
Basic
Dependencies
Zero
Heavy
-
Learning Curve
Minutes
Hours
Medium
Bundle Size
~50KB
~500KB+
-
3D Transforms
✅ Full
❌
Limited
Physics Engine
✅ Built-in
❌
❌
Particle System
✅ Complete
❌
❌
Keyframe API
✅ Native
Via JSON
iOS 17+
visionOS
✅ Ready
Limited
✅
Accessibility
✅ Full
Partial
✅
🎬 50+ Production-Ready Animations
10 Attention Seekers : bounce, shake, pulse, wobble, swing, heartbeat, flash, tada, jello, rubberBand
16 Entrance Animations : fadeIn, slideIn, zoomIn, bounceIn, flipIn, dropIn, rollIn, and directional variants
16 Exit Animations : fadeOut, slideOut, zoomOut, bounceOut, flipOut, hinge, rollOut, and directional variants
8 Continuous Animations : spin, float, glow, breathe, shimmer, wave, orbit
Fade, Slide, Zoom, Flip, Cube, Cards, Parallax, Reveal, Push, Modal, Book, Carousel
Spinner, Dots, Pulse, Bars, Circular, Wave, Bounce, Gradient, Orbit, Ripple, Morphing, Typing, Skeleton, Shimmer, Heartbeat
Tap Scale, Tap Bounce, Long Press Glow, Hover Lift, Success Check, Error Shake, Like Heart, Add to Cart, Toggle Switch, Ripple Feedback, Expand/Collapse
Slide, Fade, Zoom, Flip, Cube, Cards, Parallax, Reveal, Push, Modal, Book, Carousel
Physics Animations : Gravity, Pendulum, Elastic Drag, Inertial Scroll, Magnetic Snap
Keyframe Animations : Full iOS 17+ keyframe API support with presets
Path Animations : Drawing, Following, Morphing, Dash Offset
3D Transforms : Flip Cards, 3D Cube, 3D Carousel, Perspective Scroll, Fold Effect
Particle Effects : Confetti, Snow, Sparkles, Bubbles, Customizable Emitter
Automatic reduceMotion support
Configurable fallback behaviors
VoiceOver compatible
dependencies: [
. package ( url: " https://github.com/muhittincamdali/SwiftUI-Animation-Masterclass.git " , from: " 2.0.0 " )
]
File → Add Package Dependencies
Enter: https://github.com/muhittincamdali/SwiftUI-Animation-Masterclass.git
Click Add Package
import SwiftUIAnimationMasterclass
struct ContentView : View {
@State private var animate = false
var body : some View {
Image ( systemName: " heart.fill " )
. font ( . system( size: 60 ) )
. foregroundStyle ( . red)
. animate ( . heartbeat, trigger: $animate)
. onTapGesture { animate. toggle ( ) }
}
}
LoadingView ( type: . spinner, color: . blue, size: 40 )
// Or with button
LoadingButton ( isLoading: $isLoading, loadingType: . dots) {
await performAction ( )
} label: {
Text ( " Submit " )
}
Button ( " Tap Me " )
. tapBounce { print ( " Tapped! " ) }
// Success animation
SuccessCheckView ( isShowing: $showSuccess)
// Like button
LikeHeartButton ( isLiked: $isLiked, size: 30 )
FlipCard ( isFlipped: $isFlipped) {
// Front
RoundedRectangle ( cornerRadius: 16 )
. fill ( . blue)
} back: {
// Back
RoundedRectangle ( cornerRadius: 16 )
. fill ( . red)
}
Button ( " Celebrate! " ) {
showConfetti = true
}
. confetti ( isActive: $showConfetti)
Circle ( )
. elasticDrag ( maxStretch: 100 )
// Or with gravity
Circle ( )
. gravity ( isActive: $drop, acceleration: 9.8 , bounciness: 0.6 )
Animation
Preview
Usage
Bounce
🔵
.animate(.bounce, trigger: $trigger)
Shake
🔴
.animate(.shake, trigger: $trigger)
Pulse
🟢
.animate(.pulse, trigger: $trigger)
Wobble
🟡
.animate(.wobble, trigger: $trigger)
Swing
🟣
.animate(.swing, trigger: $trigger)
Heartbeat
❤️
.animate(.heartbeat, trigger: $trigger)
Flash
⚡
.animate(.flash, trigger: $trigger)
Tada
🎉
.animate(.tada, trigger: $trigger)
Jello
🍮
.animate(.jello, trigger: $trigger)
Rubber Band
🎈
.animate(.rubberBand, trigger: $trigger)
Animation
Usage
Fade In
.animate(.fadeIn, trigger: $trigger)
Fade In Up
.animate(.fadeInUp, trigger: $trigger)
Fade In Down
.animate(.fadeInDown, trigger: $trigger)
Slide In
.animate(.slideIn(from: .leading), trigger: $trigger)
Zoom In
.animate(.zoomIn, trigger: $trigger)
Bounce In
.animate(.bounceIn, trigger: $trigger)
Flip In X
.animate(.flipInX, trigger: $trigger)
Flip In Y
.animate(.flipInY, trigger: $trigger)
Drop In
.animate(.dropIn, trigger: $trigger)
Roll In
.animate(.rollIn, trigger: $trigger)
Animation
Usage
Fade Out
.animate(.fadeOut, trigger: $trigger)
Slide Out
.animate(.slideOut(to: .trailing), trigger: $trigger)
Zoom Out
.animate(.zoomOut, trigger: $trigger)
Bounce Out
.animate(.bounceOut, trigger: $trigger)
Flip Out
.animate(.flipOutX, trigger: $trigger)
Hinge
.animate(.hinge, trigger: $trigger)
Roll Out
.animate(.rollOut, trigger: $trigger)
Animation
Usage
Spin
.animate(.spin, trigger: $trigger, repeatForever: true)
Float
.animate(.float, trigger: $trigger, repeatForever: true)
Glow
.animate(.glow, trigger: $trigger, repeatForever: true)
Breathe
.animate(.breathe, trigger: $trigger, repeatForever: true)
Shimmer
.animate(.shimmer, trigger: $trigger, repeatForever: true)
Wave
.animate(.wave, trigger: $trigger, repeatForever: true)
Orbit
.animate(.orbit, trigger: $trigger, repeatForever: true)
Chained Animations with Keyframes
KeyframePresets . bouncyEntrance ( trigger: $animate) {
Text ( " Hello World " )
}
KeyframePresets . attention ( trigger: $shake) {
Button ( " Attention! " )
}
// Use presets
withAnimation ( SpringPresets . bouncy) {
scale = 1.2
}
// Or custom
withAnimation ( SpringPresets . custom ( response: 0.4 , damping: 0.6 ) ) {
offset = 100
}
// Animated drawing
DrawingPathView (
path: PathPresets . heart ( in: rect) ,
strokeColor: . red,
duration: 2.0 ,
trigger: $draw
)
// Follow path
PathFollowingView ( path: PathPresets . spiral ( in: rect) ) {
Circle ( )
. fill ( . blue)
. frame ( width: 20 , height: 20 )
}
Carousel3D ( currentIndex: $index, itemCount: 5 , radius: 200 ) { i in
RoundedRectangle ( cornerRadius: 16 )
. fill ( colors [ i] )
. overlay ( Text ( " Item \( i) " ) )
}
PageTransitionContainer (
transitionType: . cube,
currentPage: $currentPage,
pageCount: 5
) { page in
PageView ( index: page)
}
// Snow effect
VStack { }
. snowEffect ( particleCount: 50 )
// Sparkles
Image ( systemName: " star.fill " )
. sparkleEffect ( particleCount: 30 )
// Custom confetti
ConfettiView (
isActive: $celebrate,
colors: [ . red, . blue, . green] ,
particleCount: 100
)
graph TB
subgraph "Animation Layer"
A[AnimationType] --> B[AnimationModifier]
B --> C[Physics Engine]
B --> D[Keyframe Engine]
end
subgraph "Effect Layer"
E[Transitions] --> F[Page Transitions]
G[Loading] --> H[Micro-interactions]
I[Particles] --> J[3D Transforms]
end
subgraph "Integration"
K[View Extensions]
L[Accessibility]
end
A --> K
E --> K
L --> B
style A fill:#FA7343
style K fill:#4A90D9
style L fill:#50C878
Loading
SwiftUI-Animation-Masterclass/
├── Sources/
│ ├── SwiftUIAnimationMasterclass/ # Main exports
│ ├── Animations/ # Core animation types
│ ├── Transitions/ # Transition presets
│ ├── Loading/ # Loading animations
│ ├── MicroInteractions/ # UI micro-interactions
│ ├── PageTransitions/ # Page transition system
│ ├── Physics/ # Physics-based animations
│ ├── Keyframes/ # Keyframe animations
│ ├── Path/ # Path animations
│ ├── 3D/ # 3D transforms
│ └── Particles/ # Particle effects
├── Examples/ # Sample projects
├── Tests/ # Unit tests
└── Documentation/ # Guides
Platform
Minimum Version
iOS
17.0+
macOS
14.0+
watchOS
10.0+
tvOS
17.0+
visionOS
1.0+
Swift
5.9+
Xcode
15.0+
Metric
Value
Memory Overhead
< 1KB per animation
CPU Impact
Minimal (Core Animation)
Battery
Optimized for 60fps
Bundle Size
~50KB
Dependencies
Zero
Contributions are welcome! Please read our Contributing Guide .
git clone https://github.com/muhittincamdali/SwiftUI-Animation-Masterclass.git
cd SwiftUI-Animation-Masterclass
open Package.swift
MIT License — see LICENSE for details.
Muhittin Camdali
⭐ Star this repo if you find it useful!