SDWebImage / SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage
https://sdwebimage.github.io/SDWebImageSwiftUI
MIT License
2.16k stars 223 forks source link

AnimatedImage not loading gif from assets #152

Closed shahbaz07 closed 3 years ago

shahbaz07 commented 3 years ago

I am trying to a gif from assets using AnimatedImage, but it's not loading. Please let me know how I can do that. I am using below mention code.

AnimatedImage(name: "loading.gif", isAnimating: .constant(true)) .resizable() .scaledToFit()

dreampiggy commented 3 years ago

gif from assets

You means, Photos PHAssert library image ?

shahbaz07 commented 3 years ago

I was adding gif in Assets.xcassets. But now I moved it outside in resources folder and it is working fine.

dreampiggy commented 3 years ago

xcassets does not supports Animation at all. This is limited by Xcode and Apple, not something we can control. Moving gif or webp out of xcassets and use Bundle path to load is OK.

shahbaz07 commented 3 years ago

Thanks for the explanation.