KFImage를 이용하여 불러오는 이미지 다운샘플링

This commit is contained in:
Yu Sung
2024-10-11 18:16:24 +09:00
parent eba9e4dec2
commit 9a461f14ad
64 changed files with 527 additions and 0 deletions

View File

@@ -23,6 +23,13 @@ struct SectionEventBannerView: View {
let item = items[index]
if let url = item.thumbnailImageUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) {
KFImage(URL(string: url))
.cancelOnDisappear(true)
.downsampling(
size: CGSize(
width: proxy.size.width,
height: proxy.size.height
)
)
.resizable()
.frame(width: proxy.size.width, height: proxy.size.height, alignment: .center)
.tag(index)
@@ -35,6 +42,13 @@ struct SectionEventBannerView: View {
}
} else {
KFImage(URL(string: item.thumbnailImageUrl))
.cancelOnDisappear(true)
.downsampling(
size: CGSize(
width: proxy.size.width,
height: proxy.size.height
)
)
.resizable()
.frame(width: proxy.size.width, height: proxy.size.height, alignment: .center)
.tag(index)