[ADD] iOS 13 compatible AsyncImage implementation with cache

This commit is contained in:
Fabian Thies
2022-11-27 00:26:15 +01:00
parent 16a8bce102
commit ca7acc17da
8 changed files with 143 additions and 60 deletions

View File

@@ -7,6 +7,7 @@
//
import SwiftUI
import AsyncImage
import AltStoreCore
struct BrowseAppPreviewView: View {
@@ -23,16 +24,15 @@ struct BrowseAppPreviewView: View {
if !storeApp.screenshotURLs.isEmpty {
HStack {
ForEach(storeApp.screenshotURLs.prefix(2)) { url in
if #available(iOS 15.0, *) {
AsyncImage(url: url) { image in
image
.resizable()
.aspectRatio(contentMode: .fit)
} placeholder: {
Color(UIColor.secondarySystemBackground)
}
.cornerRadius(8)
AsyncImage(url: url) { image in
image
.resizable()
.aspectRatio(contentMode: .fit)
} placeholder: {
Color(UIColor.secondarySystemBackground)
.aspectRatio(9/16, contentMode: .fit)
}
.cornerRadius(8)
}
}
.frame(height: 300)