From 1f3d6b0fe38be92b9781e1e348d959e0f69f9318 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Thu, 2 Mar 2023 15:59:38 +0900 Subject: [PATCH 1/4] feat :: SPM.Kingfisher --- .../ProjectDescriptionHelpers/Dependency+SPM.swift | 1 + Projects/Modules/FeatureThirdPartyLib/Project.swift | 3 ++- Tuist/Dependencies.swift | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Plugin/UtilityPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift b/Plugin/UtilityPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift index 3c2711d8..11543df4 100644 --- a/Plugin/UtilityPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift +++ b/Plugin/UtilityPlugin/ProjectDescriptionHelpers/Dependency+SPM.swift @@ -11,6 +11,7 @@ public extension TargetDependency.SPM { static let Needle = TargetDependency.external(name: "NeedleFoundation") static let Moya = TargetDependency.external(name: "Moya") static let CombineMoya = TargetDependency.external(name: "CombineMoya") + static let Kingfisher = TargetDependency.external(name: "Kingfisher") } public extension Package { diff --git a/Projects/Modules/FeatureThirdPartyLib/Project.swift b/Projects/Modules/FeatureThirdPartyLib/Project.swift index 63e846da..ce51fa26 100644 --- a/Projects/Modules/FeatureThirdPartyLib/Project.swift +++ b/Projects/Modules/FeatureThirdPartyLib/Project.swift @@ -6,6 +6,7 @@ let project = Project.makeModule( name: "FeatureThirdPartyLib", product: .framework, dependencies: [ - .SPM.Needle + .SPM.Needle, + .SPM.Kingfisher ] ) diff --git a/Tuist/Dependencies.swift b/Tuist/Dependencies.swift index c154a55b..bbfe2b60 100644 --- a/Tuist/Dependencies.swift +++ b/Tuist/Dependencies.swift @@ -9,7 +9,8 @@ let dependencies = Dependencies( .remote(url: "https://github.com/Quick/Quick.git", requirement: .upToNextMajor(from: "5.0.1")), .remote(url: "https://github.com/Quick/Nimble.git", requirement: .upToNextMajor(from: "10.0.0")), .remote(url: "https://github.com/uber/needle.git", requirement: .upToNextMajor(from: "0.19.0")), - .remote(url: "https://github.com/team-aliens/Moya.git", requirement: .branch("master")) + .remote(url: "https://github.com/team-aliens/Moya.git", requirement: .branch("master")), + .remote(url: "https://github.com/onevcat/Kingfisher.git", requirement: .upToNextMajor(from: "7.0")) ], baseSettings: .settings( configurations: [ From 6e0265eb552cee7ea4384815855a544ec964c301 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Thu, 2 Mar 2023 18:09:31 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat=20::=20kingfisher=20=EC=8B=9C=EB=8F=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift b/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift index d603da87..95c7e90d 100644 --- a/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift +++ b/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift @@ -1,5 +1,6 @@ import DesignSystem import SwiftUI +import Kingfisher struct ChangeProfileView: View { @StateObject var viewModel: ChangeProfileViewModel @@ -27,6 +28,7 @@ struct ChangeProfileView: View { Group { if let image = viewModel.selectedImage { Image(uiImage: image) +// KFImage( .resizable() } else { Image(systemName: "person.crop.circle.fill") From a39f8b1fe1abfce5bf0a5907bf044f2cd8a48fb7 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Thu, 2 Mar 2023 19:03:10 +0900 Subject: [PATCH 3/4] =?UTF-8?q?feat=20::=20kingfisher=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChangeProfile/ChangeProfileView.swift | 8 +++-- .../Sources/MyPage/MyPageView.swift | 32 +++++++++---------- .../SignupProfileImageView.swift | 8 +++-- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift b/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift index 95c7e90d..e7bae1b1 100644 --- a/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift +++ b/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift @@ -27,9 +27,11 @@ struct ChangeProfileView: View { ZStack(alignment: .bottomTrailing) { Group { if let image = viewModel.selectedImage { - Image(uiImage: image) -// KFImage( - .resizable() + KFImage(URL(string: "")) + .placeholder { _ in + Image(uiImage: image) + .resizable() + } } else { Image(systemName: "person.crop.circle.fill") .resizable() diff --git a/Projects/Features/MyPageFeature/Sources/MyPage/MyPageView.swift b/Projects/Features/MyPageFeature/Sources/MyPage/MyPageView.swift index 6b1429ba..266b14b1 100644 --- a/Projects/Features/MyPageFeature/Sources/MyPage/MyPageView.swift +++ b/Projects/Features/MyPageFeature/Sources/MyPage/MyPageView.swift @@ -1,6 +1,7 @@ import BaseFeature import DesignSystem import SwiftUI +import Kingfisher struct MyPageView: View { @StateObject var viewModel: MyPageViewModel @@ -57,22 +58,21 @@ struct MyPageView: View { Spacer() ZStack(alignment: .bottomTrailing) { - AsyncImage(url: viewModel.profile?.profileImageURL) { image in - image - .resizable() - .aspectRatio(contentMode: .fill) - .frame(width: 74, height: 74) - .clipShape(Circle()) - .scaledToFill() - } placeholder: { - ProgressView() - .progressViewStyle( - CircularProgressViewStyle(tint: .white) - ) - .frame(width: 74, height: 74) - .background(Color.GrayScale.gray5) - .clipShape(Circle()) - } + KFImage(viewModel.profile?.profileImageURL) + .placeholder { _ in + ProgressView() + .progressViewStyle( + CircularProgressViewStyle(tint: .white) + ) + .frame(width: 74, height: 74) + .background(Color.GrayScale.gray5) + .clipShape(Circle()) + } + .resizable() + .aspectRatio(contentMode: .fill) + .frame(width: 74, height: 74) + .clipShape(Circle()) + .scaledToFill() Circle() .fill(Color.GrayScale.gray3) diff --git a/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift b/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift index c000f63a..6b56d9a8 100644 --- a/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift +++ b/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift @@ -1,5 +1,6 @@ import DesignSystem import SwiftUI +import Kingfisher struct SignupProfileImageView: View { @StateObject var viewModel: SignupProfileImageViewModel @@ -29,8 +30,11 @@ struct SignupProfileImageView: View { ZStack(alignment: .bottomTrailing) { Group { if let image = viewModel.selectedImage { - Image(uiImage: image) - .resizable() + KFImage(URL(string: "")) + .placeholder { _ in + Image(uiImage: image) + .resizable() + } } else { Image(systemName: "person.crop.circle.fill") .resizable() From c84ea5650c6cac0ef14623f2737b2460afdb3cc3 Mon Sep 17 00:00:00 2001 From: "hsj._.06" Date: Thu, 2 Mar 2023 19:17:51 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix=20::=20kingfisher=20=ED=95=84=EC=9A=94?= =?UTF-8?q?=EC=97=86=EB=8A=94=EB=B6=80=EB=B6=84=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/ChangeProfile/ChangeProfileView.swift | 8 ++------ .../SignupProfileImage/SignupProfileImageView.swift | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift b/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift index e7bae1b1..d603da87 100644 --- a/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift +++ b/Projects/Features/MyPageFeature/Sources/ChangeProfile/ChangeProfileView.swift @@ -1,6 +1,5 @@ import DesignSystem import SwiftUI -import Kingfisher struct ChangeProfileView: View { @StateObject var viewModel: ChangeProfileViewModel @@ -27,11 +26,8 @@ struct ChangeProfileView: View { ZStack(alignment: .bottomTrailing) { Group { if let image = viewModel.selectedImage { - KFImage(URL(string: "")) - .placeholder { _ in - Image(uiImage: image) - .resizable() - } + Image(uiImage: image) + .resizable() } else { Image(systemName: "person.crop.circle.fill") .resizable() diff --git a/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift b/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift index 6b56d9a8..c000f63a 100644 --- a/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift +++ b/Projects/Features/SignupFeature/Sources/SignupProfileImage/SignupProfileImageView.swift @@ -1,6 +1,5 @@ import DesignSystem import SwiftUI -import Kingfisher struct SignupProfileImageView: View { @StateObject var viewModel: SignupProfileImageViewModel @@ -30,11 +29,8 @@ struct SignupProfileImageView: View { ZStack(alignment: .bottomTrailing) { Group { if let image = viewModel.selectedImage { - KFImage(URL(string: "")) - .placeholder { _ in - Image(uiImage: image) - .resizable() - } + Image(uiImage: image) + .resizable() } else { Image(systemName: "person.crop.circle.fill") .resizable()