
Particle Assemble Splash
Hundreds of glowing particles swirl in from the edges of a dark screen and settle into your app's SF Symbol, sampled pixel by pixel. They hold for a beat, then burst outward as the app fades in underneath, all drawn in one Canvas.
- screen
- animation
- motion
snippet.swift327 lines
6 files • Scroll to see all →
/// A launch splash where a field of glowing particles swirls in from the edges,/// settles into your app's symbol, holds for a breath, then bursts outward/// while the app fades up underneath.////// Target points are sampled from the SF Symbol itself (rendered once with/// `ImageRenderer`, then read pixel by pixel), so any filled symbol works./// Every frame is drawn by one `Canvas` inside a `TimelineView`: positions are a/// pure function of time, so there is no per-particle state to animate.public struct ParticleAssembleSplash<Content: View>: View { let systemImage: String let appName: String? var colors: [Color] var background: Color var particleCount: Int var symbolSize: CGFloat var holdDuration: Double var onFinished: () -> Void let content: Content private enum Phase: Equatable { case waiting, assembling, holding, bursting, done }// ... (click "Show full code" to see more)Viewing: ParticleAssembleSplash.swift•1 of 6