If you create a list of the following view as rows:
struct ImageCellView: View {
let image: UIImage
init(image: UIImage) {
self.image = image
}
var body: some View {
return Image(uiImage: image).frame(height: 128).clipped()
}
}
After cells are deleted, memory for UIImage is not released until new cells are added. Looking at the memory graph we can figure out that AGGraphStorage is holding reference for this:
Even if adding new cells can somehow free memory, UIImage is leaked occasionally:
Is this a bug in SwiftUI? Is there any way to get rid of this behavior?

