Hello,
I saw so many overly complicated and most of the time not working solutions to display gif with SwiftUI, from the WKWebView to the 5000 lines of CoreGraphics code that it depressed me. So I made a little Swift Package to help everyone get through this. It's, for what I know, the simplest, most efficient, lightweight and high performance solution currently. Feel free to use it.
Just embed the package and use GIFView instead of Image in SwiftUI and it will works just fine.
let data = /* your gif data, wherever it's stored */
var body: some View {
GIFView(data)
}
Here is the link to the package : https://github.com/raphaelwach/SwiftGIF