refactor: AsyncImage -> KFImage 로 변경
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Kingfisher
|
||||
|
||||
struct ImageViewerView: View {
|
||||
let images: [String]
|
||||
@@ -18,14 +19,15 @@ struct ImageViewerView: View {
|
||||
|
||||
TabView(selection: $selectedIndex) {
|
||||
ForEach(Array(images.enumerated()), id: \.offset) { index, imageUrl in
|
||||
AsyncImage(url: URL(string: imageUrl)) { image in
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
} placeholder: {
|
||||
ProgressView()
|
||||
.tint(.white)
|
||||
}
|
||||
KFImage(URL(string: imageUrl))
|
||||
.placeholder {
|
||||
ProgressView()
|
||||
.tint(.white)
|
||||
}
|
||||
.cancelOnDisappear(true)
|
||||
.downsampling(size: CGSize(width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.tag(index)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user