I'm using SDWebImage
to display images from a firestore database and currently getting the error:
Fatal error: Unexpectedly found nil while unwrapping an Optional value.
Not quite certain how to do the if check to prevent the force unwrapping so would appreciate if anyone can show me an alternate syntax example.
@ObservedObject var movies = getMoviesData()
...
ForEach(self.movies.datas) { item in
VStack {
Button(action: {}) {
AnimatedImage(url: URL(string: item.img)!)
.resizable()
.frame(height: 425)
.padding(.bottom,15)
.cornerRadius(5)
}
}
}
Also tried comparing to nil (as suggested in the article: What does "Fatal error: Unexpectedly found nil while unwrapping an Optional value" mean?) but not working.