This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State private var start = Date.now | |
var body: some View { | |
VStack { | |
TimelineView(.animation) { timeline in | |
let time = start.distance(to: timeline.date) | |
Rectangle() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import MetalKit | |
struct Particle { | |
let color: SIMD4<Float> | |
let radius: Float | |
let lifespan: Float | |
let position: SIMD2<Float> | |
let velocity: SIMD2<Float> | |
} |