feat(image): 메인 홈, 채팅 - 톡 페이지에 DownsampledKFImage 적용

- 수평 리스트 HStack → LazyHStack으로 교체해 프리로딩/메모리 개선
This commit is contained in:
Yu Sung
2025-10-23 18:55:53 +09:00
parent 62012bd722
commit 8221746569
12 changed files with 57 additions and 72 deletions

View File

@@ -17,12 +17,11 @@ struct ContentItemView: View {
var body: some View {
VStack(alignment: .leading, spacing: 0) {
ZStack(alignment: .top) {
KFImage(URL(string: item.coverImageUrl))
.cancelOnDisappear(true)
.resizable()
.scaledToFill()
.frame(width: 160, height: 160, alignment: .top)
.cornerRadius(16)
DownsampledKFImage(
url: URL(string: item.coverImageUrl),
size: CGSize(width: 160, height: 160)
)
.cornerRadius(16)
HStack(alignment: .top, spacing: 0) {
Spacer()

View File

@@ -112,13 +112,11 @@ struct ContentMainBannerImageView: View {
var body: some View {
Group {
if let boundURL {
KFImage(boundURL)
.cancelOnDisappear(true)
.downsampling(size: CGSize(width: width, height: height))
.resizable()
.scaledToFill()
.frame(width: width, height: height)
.cornerRadius(4.7)
DownsampledKFImage(
url: boundURL,
size: CGSize(width: width, height: height)
)
.cornerRadius(4.7)
} else {
Color.clear
.frame(width: width, height: height)

View File

@@ -56,7 +56,7 @@ struct DayOfWeekSeriesView: View {
.padding(.horizontal, 24)
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 5) {
LazyHStack(spacing: 5) {
ForEach(0..<dayOfWeekItems.count, id: \.self) {
let item = dayOfWeekItems[$0]
DayOfWeekDayView(dayOfWeek: item.dayOfWeekStr, isSelected: dayOfWeek == item.dayOfWeek)
@@ -72,7 +72,7 @@ struct DayOfWeekSeriesView: View {
}
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 16) {
LazyHStack(spacing: 16) {
ForEach(0..<seriesList.count, id: \.self) {
SeriesItemView(item: seriesList[$0])
}

View File

@@ -17,13 +17,12 @@ struct SeriesItemView: View {
var body: some View {
VStack(alignment: .leading, spacing: 4) {
ZStack {
KFImage(URL(string: item.coverImage))
.cancelOnDisappear(true)
.resizable()
.scaledToFill()
.frame(width: 160, height: 227, alignment: .center)
.cornerRadius(16)
.clipped()
DownsampledKFImage(
url: URL(string: item.coverImage),
size: CGSize(width: 160, height: 227)
)
.cornerRadius(16)
.clipped()
VStack(alignment: .leading, spacing: 0) {
HStack(spacing: 0) {