From ed82281c436c9dd069dbfa7b2a9ee4d2b3656066 Mon Sep 17 00:00:00 2001 From: J0onYEong Date: Sat, 23 Nov 2024 01:32:26 +0900 Subject: [PATCH] =?UTF-8?q?SwiftUI=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EC=A4=91=EB=B3=B5=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EB=B0=8F=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=EA=B0=80=20=EB=A1=9C=EB=93=9C=EB=90=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extension/SwiftUI/Image+Extension.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/SimpleImageProvider/Extension/SwiftUI/Image+Extension.swift b/Sources/SimpleImageProvider/Extension/SwiftUI/Image+Extension.swift index 5eb5163..32a85d1 100644 --- a/Sources/SimpleImageProvider/Extension/SwiftUI/Image+Extension.swift +++ b/Sources/SimpleImageProvider/Extension/SwiftUI/Image+Extension.swift @@ -19,12 +19,13 @@ class ImageLoader: @unchecked Sendable, ObservableObject { self.url = url self.size = size self.fadeOutduration = fadeOutduration - - loadImage() } func loadImage() { + // 기존 이미지를 초기화 + uiImage = nil + Task { let image = await SimpleImageProvider.shared @@ -60,10 +61,13 @@ public struct SimpleImage: View { Image(uiImage: uiImage) .resizable() .aspectRatio(contentMode: .fit) - } else { Text("") + .onAppear { + + imageLoader.loadImage() + } } } }