From ad0cf3c0c2dc5aed03cec965bc0253b0d48c92e7 Mon Sep 17 00:00:00 2001 From: Christian Elies Date: Fri, 27 Mar 2020 15:53:37 +0100 Subject: [PATCH] fix(): image didn't appear (moved fetching image from onAppear to initializer) --- Sources/RemoteImage/public/Views/RemoteImage.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Sources/RemoteImage/public/Views/RemoteImage.swift b/Sources/RemoteImage/public/Views/RemoteImage.swift index 28270a5..c3cd4ad 100644 --- a/Sources/RemoteImage/public/Views/RemoteImage.swift +++ b/Sources/RemoteImage/public/Views/RemoteImage.swift @@ -40,9 +40,6 @@ public struct RemoteImage: case .loading: return AnyView( loadingView() - .onAppear { - self.service.fetchImage(ofType: self.type) - } ) } } @@ -52,6 +49,8 @@ public struct RemoteImage: self.errorView = errorView self.imageView = imageView self.loadingView = loadingView + + service.fetchImage(ofType: type) } }