feat(image): DownsampledKFImage 추가 및 캐릭터/배너에 공통 적용

- KFImage 공통 옵션(다운샘플링, scaleFactor, backgroundDecode,
  cancelOnDisappear, retry) 캡슐화한 DownsampledKFImage 추가
- 채팅-캐릭터 탭 Character/Recent/배너 뷰에서 인라인 KFImage 제거 → 공통 뷰 적용
- 수평 리스트 HStack → LazyHStack으로 교체해 프리로딩/메모리 개선

Why: 대형 원본 디코딩으로 인한 메모리 스파이크 완화 및 일관된
이미지 로딩 정책 적용. 유지보수성 및 성능 향상.
This commit is contained in:
Yu Sung
2025-10-23 17:10:04 +09:00
parent 8c58c08a85
commit 62012bd722
6 changed files with 61 additions and 29 deletions

View File

@@ -84,16 +84,10 @@ private struct AutoSlideCharacterBannerPage: View {
var body: some View {
Group {
if let boundURL {
KFImage(boundURL)
.placeholder { Color.gray.opacity(0.2) }
.retry(maxCount: 2, interval: .seconds(1))
.cancelOnDisappear(true)
.downsampling(size: CGSize(width: width, height: height))
.resizable()
.scaledToFill()
.frame(width: width, height: height)
.clipped()
.cornerRadius(12)
DownsampledKFImage(
url: boundURL,
size: CGSize(width: width, height: height)
).cornerRadius(12)
} else {
Color.clear
.frame(width: width, height: height)