agg23 / AsyncAnimatedImage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-03-06.at.19.15.47.mp4
import SwiftUI
import AsyncAnimatedImage

let url = URL(string: "https://static-cdn.jtvnw.net/emoticons/v2/emotesv2_5d523adb8bbb4786821cd7091e47da21/default/dark/2.0")!

struct CellView: View {
    var body: some View {
        Text("CHOMPCHOMP: \(AsyncAnimatedImage(url: url))")
            .drawingGroup() // this is useful when you are using lots of GIFs
    }
}

struct ContentView: View {
    var body: some View {
        List {
            ForEach(0..<100) { _ in
                CellView()
            }
        }
    }
}

@main
struct TestApp: App {
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

About

License:MIT License


Languages

Language:Swift 100.0%