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

@@ -13,14 +13,11 @@ struct RecentCharacterItemView: View {
var body: some View {
VStack(spacing: 6) {
KFImage(URL(string: character.imageUrl))
.placeholder { Circle().fill(Color.gray.opacity(0.2)) }
.retry(maxCount: 2, interval: .seconds(1))
.cancelOnDisappear(true)
.resizable()
.scaledToFill()
.frame(width: 76, height: 76)
.clipShape(Circle())
DownsampledKFImage(
url: URL(string: character.imageUrl),
size: CGSize(width: 76, height: 76)
)
.clipShape(Circle())
Text(character.name)
.font(.custom(Font.preRegular.rawValue, size: 18))