Here’s what I’ve carried out: the app crashes when the reminiscence goes over 1 GB or extra. I attempted commenting asyncImage, and it took solely 25–30 MB of reminiscence and did not crash.
Record {
ForEach(0..<(self.imageURLArray.depend), id: .self) { i in
AsyncImage(url: URL(string: self.imageURLArray[i])) { picture in
picture.resizable()
.aspectRatio(16/9, contentMode: .match)
.cornerRadius(10, antialiased: true)
.padding(.horizontal)
.padding(.vertical, 5)
}
placeholder: {
ZStack {
RoundedRectangle(cornerRadius: 10)
.foregroundColor(.black.opacity(0.1))
.aspectRatio(16/9, contentMode: .match)
.padding(.horizontal)
.padding(.vertical, 10)
ProgressView()
.progressViewStyle(.round)
}
}
.onAppear {
if self.imageURLArray[i] == self.imageURLArray.final {
self.loadMoreItems()
}
}
}
.listRowInsets(EdgeInsets())
}