KFImage를 이용하여 불러오는 이미지 다운샘플링
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user