From d9fcdff7a25fc907b1e6bdffa654f1c7bd71fe9c Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Thu, 23 Oct 2025 19:03:54 +0900 Subject: [PATCH] =?UTF-8?q?feat(image):=20=EB=A9=94=EC=9D=B8=20=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=B8=8C=20=ED=83=AD=EC=97=90=20DownsampledKFImage=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 수평 리스트 HStack → LazyHStack으로 교체해 프리로딩/메모리 개선 --- SodaLive/Sources/Live/Now/LiveNowItemView.swift | 10 +++++----- SodaLive/Sources/Live/Now/SectionLiveNowView.swift | 2 +- .../Live/Reservation/LiveReservationItemView.swift | 12 +++++------- .../Live/Reservation/MyLiveReservationItemView.swift | 12 +++++------- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/SodaLive/Sources/Live/Now/LiveNowItemView.swift b/SodaLive/Sources/Live/Now/LiveNowItemView.swift index 17df36d..02615c6 100644 --- a/SodaLive/Sources/Live/Now/LiveNowItemView.swift +++ b/SodaLive/Sources/Live/Now/LiveNowItemView.swift @@ -27,11 +27,11 @@ struct LiveNowItemView: View { VStack(spacing: 0) { ZStack(alignment: .bottom) { ZStack { - KFImage(URL(string: item.creatorProfileImage)) - .cancelOnDisappear(true) - .resizable() - .frame(width: 72, height: 72) - .clipShape(Circle()) + DownsampledKFImage( + url: URL(string: item.creatorProfileImage), + size: CGSize(width: 72, height: 72) + ) + .clipShape(Circle()) } .frame(width: 84, height: 84) .overlay { diff --git a/SodaLive/Sources/Live/Now/SectionLiveNowView.swift b/SodaLive/Sources/Live/Now/SectionLiveNowView.swift index d910a5f..5eb6bcc 100644 --- a/SodaLive/Sources/Live/Now/SectionLiveNowView.swift +++ b/SodaLive/Sources/Live/Now/SectionLiveNowView.swift @@ -42,7 +42,7 @@ struct SectionLiveNowView: View { if items.count > 0 { ScrollView(.horizontal, showsIndicators: false) { - HStack(alignment: .top, spacing: 16) { + LazyHStack(alignment: .top, spacing: 16) { ForEach(items, id: \.self) { item in LiveNowItemView(item: item) .contentShape(Rectangle()) diff --git a/SodaLive/Sources/Live/Reservation/LiveReservationItemView.swift b/SodaLive/Sources/Live/Reservation/LiveReservationItemView.swift index f4a5a5b..b3d64ed 100644 --- a/SodaLive/Sources/Live/Reservation/LiveReservationItemView.swift +++ b/SodaLive/Sources/Live/Reservation/LiveReservationItemView.swift @@ -17,13 +17,11 @@ struct LiveReservationItemView: View { var body: some View { HStack(spacing: 16) { ZStack(alignment: .topLeading) { - KFImage(URL(string: item.creatorProfileImage)) - .cancelOnDisappear(true) - .resizable() - .scaledToFill() - .frame(width: 100, height: 100, alignment: .top) - .cornerRadius(16) - .clipped() + DownsampledKFImage( + url: URL(string: item.creatorProfileImage), + size: CGSize(width: 100, height: 100) + ) + .cornerRadius(16) if item.isPrivateRoom { Image("ic_lock") diff --git a/SodaLive/Sources/Live/Reservation/MyLiveReservationItemView.swift b/SodaLive/Sources/Live/Reservation/MyLiveReservationItemView.swift index ede22d0..1b1f705 100644 --- a/SodaLive/Sources/Live/Reservation/MyLiveReservationItemView.swift +++ b/SodaLive/Sources/Live/Reservation/MyLiveReservationItemView.swift @@ -29,13 +29,11 @@ struct MyLiveReservationItemView: View { HStack(spacing: 16) { ZStack(alignment: .topLeading) { - KFImage(URL(string: item.creatorProfileImage)) - .cancelOnDisappear(true) - .resizable() - .scaledToFill() - .frame(width: 100, height: 100, alignment: .top) - .cornerRadius(16) - .clipped() + DownsampledKFImage( + url: URL(string: item.creatorProfileImage), + size: CGSize(width: 100, height: 100) + ) + .cornerRadius(16) if item.isPrivateRoom { Image("ic_lock")