From fc1ab63d07fdce0e15c1422f4b6fa96d26fe97f2 Mon Sep 17 00:00:00 2001 From: hryeong66 Date: Wed, 7 Aug 2024 18:11:08 +0900 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=B0=88=20=EB=B3=B5=EC=82=AC=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20popup=20=EC=B6=94=EA=B0=80=20(#63)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Sources/AppDelegate.swift | 1 - Projects/Features/MyPage/Sources/MyPageView.swift | 5 +++++ Projects/Features/MyPage/Sources/MyPageViewModel.swift | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Projects/App/Sources/AppDelegate.swift b/Projects/App/Sources/AppDelegate.swift index 1dfe554..3c80cf5 100644 --- a/Projects/App/Sources/AppDelegate.swift +++ b/Projects/App/Sources/AppDelegate.swift @@ -9,7 +9,6 @@ import UIKit import SwiftUI import Home -import MemeDetail import PPACUtil @main diff --git a/Projects/Features/MyPage/Sources/MyPageView.swift b/Projects/Features/MyPage/Sources/MyPageView.swift index 49821ab..7b35102 100644 --- a/Projects/Features/MyPage/Sources/MyPageView.swift +++ b/Projects/Features/MyPage/Sources/MyPageView.swift @@ -52,6 +52,11 @@ public struct MyPageView: View { .padding(.top, 51) .edgesIgnoringSafeArea(.all) } + .popup( + isActive: $viewModel.state.isActiveCopyPopup, + image: ResourceKitAsset.Icon.copyFilled.swiftUIImage, + text: "이미지를 클립보드에 복사했어요" + ) } var blurView: some View { diff --git a/Projects/Features/MyPage/Sources/MyPageViewModel.swift b/Projects/Features/MyPage/Sources/MyPageViewModel.swift index 4fe29cf..fbeb36c 100644 --- a/Projects/Features/MyPage/Sources/MyPageViewModel.swift +++ b/Projects/Features/MyPage/Sources/MyPageViewModel.swift @@ -32,7 +32,8 @@ final public class MyPageViewModel: ViewModelType, ObservableObject { var lastSeenMemeList: [MemeDetail] var savedMemeList: [MemeDetail] var savedMemePagination: MemeListWithPagination.Pagination - var isRefreshCompleted: Bool + var isRefreshCompleted: Bool = true + var isActiveCopyPopup: Bool = false var memeLevel: MemeLevelType { return MemeLevelType(rawValue: userDetail.level) ?? .level1 @@ -82,8 +83,7 @@ final public class MyPageViewModel: ViewModelType, ObservableObject { self.state = State(userDetail: userDetail, lastSeenMemeList: [], savedMemeList: [], - savedMemePagination: .none, - isRefreshCompleted: true) + savedMemePagination: .none) self.userDetail = userDetail self.getUserDetailUseCase = getUserDetailUseCase self.getLastSeenMemeUseCase = getLastSeenMemeUseCase @@ -121,8 +121,7 @@ final public class MyPageViewModel: ViewModelType, ObservableObject { self.state = State(userDetail: userDetail, lastSeenMemeList: lastSeenMemeList, savedMemeList: savedMemeListWithPagination.memeList, - savedMemePagination: savedMemeListWithPagination.pagination, - isRefreshCompleted: true) + savedMemePagination: savedMemeListWithPagination.pagination) } catch(let error) { print("fetchUserMemes error = \(error)") } @@ -156,6 +155,7 @@ final public class MyPageViewModel: ViewModelType, ObservableObject { private func copyMemeImage(with url: String?) async { do { try await self.copyImageUseCase.execute(url: url ?? "") + self.state.isActiveCopyPopup = true } catch { print("복사 실패") } From aa8f910eb379aa305519156e759e6d1a71a3d890 Mon Sep 17 00:00:00 2001 From: hryeong66 Date: Wed, 7 Aug 2024 18:14:32 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=EA=B2=80=EC=83=89=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=20=EB=B3=B5=EC=82=AC=20=EA=B8=B0=EB=8A=A5=20popup=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20(#63)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/Features/MyPage/Sources/MyPageView.swift | 3 +++ .../Search/Sources/View/Result/SearchResultView.swift | 7 +++++++ .../Search/Sources/View/Result/SearchResultViewModel.swift | 2 ++ 3 files changed, 12 insertions(+) diff --git a/Projects/Features/MyPage/Sources/MyPageView.swift b/Projects/Features/MyPage/Sources/MyPageView.swift index 7b35102..9addeac 100644 --- a/Projects/Features/MyPage/Sources/MyPageView.swift +++ b/Projects/Features/MyPage/Sources/MyPageView.swift @@ -6,10 +6,13 @@ // import SwiftUI + import DesignSystem import ResourceKit import PPACModels +import PopupView + public struct MyPageView: View { @ObservedObject private var viewModel: MyPageViewModel diff --git a/Projects/Features/Search/Sources/View/Result/SearchResultView.swift b/Projects/Features/Search/Sources/View/Result/SearchResultView.swift index ad975c3..9e0b11b 100644 --- a/Projects/Features/Search/Sources/View/Result/SearchResultView.swift +++ b/Projects/Features/Search/Sources/View/Result/SearchResultView.swift @@ -11,6 +11,8 @@ import PPACModels import ResourceKit import DesignSystem +import PopupView + public struct SearchResultView: View { @ObservedObject var viewModel: SearchResultViewModel @@ -58,5 +60,10 @@ public struct SearchResultView: View { .onAppear { viewModel.dispatch(type: .viewWillAppear) } + .popup( + isActive: $viewModel.state.isActiveCopyPopup, + image: ResourceKitAsset.Icon.copyFilled.swiftUIImage, + text: "이미지를 클립보드에 복사했어요" + ) } } diff --git a/Projects/Features/Search/Sources/View/Result/SearchResultViewModel.swift b/Projects/Features/Search/Sources/View/Result/SearchResultViewModel.swift index 2c732bc..6fc2c17 100644 --- a/Projects/Features/Search/Sources/View/Result/SearchResultViewModel.swift +++ b/Projects/Features/Search/Sources/View/Result/SearchResultViewModel.swift @@ -33,6 +33,7 @@ public final class SearchResultViewModel: ViewModelType, ObservableObject { public struct State { var keyword: String var memeList: [MemeDetail] + var isActiveCopyPopup: Bool = false } // MARK: - Properties @@ -89,6 +90,7 @@ public final class SearchResultViewModel: ViewModelType, ObservableObject { private func copyImage(urlString: String) async { do { try await copyImageUseCase.execute(url: urlString) + state.isActiveCopyPopup = true } catch(let error) { debugPrint("error = \(error)") } From 10f032bcdfa0f51cb260c4c131c08e8349a5d480 Mon Sep 17 00:00:00 2001 From: hryeong66 Date: Thu, 8 Aug 2024 19:15:24 +0900 Subject: [PATCH 3/5] =?UTF-8?q?feat:=20=ED=83=AD=EB=B0=94=20=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EB=A1=9C?= =?UTF-8?q?=EB=9D=A0=20=EC=A0=81=EC=9A=A9=20(#63)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/MainTab/MainTab.swift | 13 +++++++ .../Sources/MainTab/MainTabView.swift | 35 +++++++++++++++---- .../Sources/View/Meme/MemeItemView.swift | 3 +- .../Sources/View/Meme/MemeListView.swift | 4 +-- .../Resources/Lottie/Tab_My.lottie | 1 + .../Resources/Lottie/Tab_Recommand.lottie | 1 + .../Resources/Lottie/Tab_Search.lottie | 1 + 7 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 Projects/ResourceKit/Resources/Lottie/Tab_My.lottie create mode 100644 Projects/ResourceKit/Resources/Lottie/Tab_Recommand.lottie create mode 100644 Projects/ResourceKit/Resources/Lottie/Tab_Search.lottie diff --git a/Projects/Core/DesignSystem/Sources/MainTab/MainTab.swift b/Projects/Core/DesignSystem/Sources/MainTab/MainTab.swift index 7e62fca..ea92381 100644 --- a/Projects/Core/DesignSystem/Sources/MainTab/MainTab.swift +++ b/Projects/Core/DesignSystem/Sources/MainTab/MainTab.swift @@ -6,7 +6,9 @@ // import SwiftUI + import ResourceKit +import Lottie public enum MainTab: String, CaseIterable, Identifiable { case recommend @@ -37,6 +39,17 @@ public enum MainTab: String, CaseIterable, Identifiable { } } + public var lottieAnimation: LottieAnimation? { + switch self { + case .recommend: + AnimationAsset.tabRecommand.animation + case .search: + AnimationAsset.tabSearch.animation + case .mypage: + AnimationAsset.tabMy.animation + } + } + public var title: String { switch self { case .recommend: diff --git a/Projects/Core/DesignSystem/Sources/MainTab/MainTabView.swift b/Projects/Core/DesignSystem/Sources/MainTab/MainTabView.swift index 07d2e1e..57040ef 100644 --- a/Projects/Core/DesignSystem/Sources/MainTab/MainTabView.swift +++ b/Projects/Core/DesignSystem/Sources/MainTab/MainTabView.swift @@ -6,7 +6,9 @@ // import SwiftUI + import ResourceKit +import Lottie public struct CustomTabBarView: View { @Binding public var selectedTab: MainTab @@ -23,7 +25,7 @@ public struct CustomTabBarView: View { } Spacer(minLength: 20) } - .frame(maxWidth: .infinity, maxHeight: 98) + .frame(maxWidth: .infinity, maxHeight: 88) .background(.white) .clipShape( .rect( @@ -37,9 +39,10 @@ public struct CustomTabBarView: View { public struct TabItemView: View { - let tab: MainTab let isSelected: Bool + @State var playbackMode: LottiePlaybackMode = .paused(at: .progress(100)) + @State var isAnimationFinished: Bool = false var tabImage: Image { return isSelected ? tab.selectedImage : tab.image @@ -51,16 +54,34 @@ public struct TabItemView: View { public var body: some View { VStack { - tabImage - .frame(width: 24, height: 24) - .padding(.bottom, 2) - + tabImageView Text(tab.title) - .font(Font.Weight.semiBold) + .font(Font.Weight.medium) } .foregroundStyle(color) .padding(40) } + + var tabImageView: some View { + ZStack { + if !isAnimationFinished && isSelected { + LottieView(animation: tab.lottieAnimation) + .playing() + .animationDidFinish { _ in + isAnimationFinished = true + } + .resizable() + .frame(width: 24, height: 24) + } else { + tabImage + .resizable() + .frame(width: 24, height: 24) + + } + } + .padding(.bottom, 6) + } + } struct TabBarModifier: ViewModifier { diff --git a/Projects/Core/DesignSystem/Sources/View/Meme/MemeItemView.swift b/Projects/Core/DesignSystem/Sources/View/Meme/MemeItemView.swift index ab0c93d..2897206 100644 --- a/Projects/Core/DesignSystem/Sources/View/Meme/MemeItemView.swift +++ b/Projects/Core/DesignSystem/Sources/View/Meme/MemeItemView.swift @@ -32,8 +32,8 @@ public struct MemeItemView: View { memeClickHandler?(memeDetail) } MemeItemInfoView(memeName: memeDetail.title, reaction: memeDetail.reaction) + .padding(.top, 10) } - .padding(.bottom, 20) } } @@ -117,7 +117,6 @@ struct MemeItemInfoView: View { } } - .padding(.bottom, 4) Spacer() } } diff --git a/Projects/Core/DesignSystem/Sources/View/Meme/MemeListView.swift b/Projects/Core/DesignSystem/Sources/View/Meme/MemeListView.swift index 371ff03..8b5c507 100644 --- a/Projects/Core/DesignSystem/Sources/View/Meme/MemeListView.swift +++ b/Projects/Core/DesignSystem/Sources/View/Meme/MemeListView.swift @@ -45,7 +45,7 @@ public struct MemeListView: View { public var body: some View { ScrollView { HStack(alignment: .top) { - LazyVStack { + LazyVStack(spacing: 20) { ForEach(oddIndexedItems) { memeDetail in MemeItemView( memeDetail: memeDetail, @@ -60,7 +60,7 @@ public struct MemeListView: View { } } - LazyVStack { + LazyVStack(spacing: 20) { ForEach(evenIndexedItems) { memeDetail in MemeItemView( memeDetail: memeDetail, diff --git a/Projects/ResourceKit/Resources/Lottie/Tab_My.lottie b/Projects/ResourceKit/Resources/Lottie/Tab_My.lottie new file mode 100644 index 0000000..f50b33e --- /dev/null +++ b/Projects/ResourceKit/Resources/Lottie/Tab_My.lottie @@ -0,0 +1 @@ +{"v":"4.8.0","meta":{"g":"LottieFiles AE 3.5.1","a":"","k":"","d":"","tc":""},"fr":29.9700012207031,"ip":0,"op":60.0000024438501,"w":100,"h":100,"nm":"mypage_new","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Layer 3 Outlines","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":6,"s":[0]},{"t":15.0000006109625,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[7.292,7.292],[0.7620000000000005,-7.292]],"o":[[7.292,-0.7620000000000005],[-7.292,-7.292]],"v":[[7.292,7.292],[-7.292,-7.292]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":7.5,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[71.875,67.708],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":2,"ty":4,"nm":"Layer 2 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[49.998,28.306,0],"ix":2},"a":{"a":0,"k":[49.998,28.306,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":10.0000004073083,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-8.721,15.79],[15.79,8.72],[8.719000000000001,-15.79],[-15.79,-8.721]],"o":[[8.719000000000001,15.79],[15.79,-8.721],[-8.721,-15.79],[-15.79,8.72]],"v":[[-0.001,15.79],[15.79,0],[-0.001,-15.79],[-15.79,0]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":8.824,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"fl","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[49.998,28.306],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":3,"ty":4,"nm":"Layer 1 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50.004,71.64,0],"ix":2},"a":{"a":0,"k":[50.004,71.64,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":10.0000004073083,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[33.644000000000005,4.545000000000001],[-20.743000000000002,12.389],[-34.187999999999995,3.758],[-22.816000000000003,-21.616999999999997],[-1.788,-15.238],[0.619,-14.885],[9.686,-17.635],[35.806999999999995,-10.860000000000001]],"o":[[2.6190000000000033,21.63],[-33.703,4.541],[-35.808,-10.82],[-9.618,-17.613],[-0.6240000000000001,-14.885],[1.784,-15.238],[22.85,-21.629],[34.186,3.7249999999999996]],"v":[[32.84,4.988],[-32.954,4.995],[-34.285,2.887],[-9.618,-17.613],[-1.788,-15.238],[1.784,-15.238],[9.686,-17.635],[34.288,2.812]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":8.824,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"fl","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[50.002,73.721],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true}],"markers":[],"__complete":true} \ No newline at end of file diff --git a/Projects/ResourceKit/Resources/Lottie/Tab_Recommand.lottie b/Projects/ResourceKit/Resources/Lottie/Tab_Recommand.lottie new file mode 100644 index 0000000..5545915 --- /dev/null +++ b/Projects/ResourceKit/Resources/Lottie/Tab_Recommand.lottie @@ -0,0 +1 @@ +{"v":"4.8.0","meta":{"g":"LottieFiles AE 3.5.1","a":"","k":"","d":"","tc":""},"fr":29.9700012207031,"ip":0,"op":60.0000024438501,"w":100,"h":100,"nm":"recommand_new","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Layer 3 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-21.487000000000002,-39.725],[14.583,-39.725],[27.083,-33.797000000000004],[27.083,26.482],[21.486,39.725],[-14.583,39.725],[-27.083,33.795],[-27.083,-26.484]],"o":[[-14.583,-39.725],[21.486,-39.725],[27.083,-26.484],[27.083,33.795],[14.583,39.725],[-21.487000000000002,39.725],[-27.083,26.482],[-27.083,-33.797000000000004]],"v":[[-14.583,-39.725],[14.583,-39.725],[27.083,-26.484],[27.083,26.482],[14.583,39.725],[-14.583,39.725],[-27.083,26.482],[-27.083,-26.484]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10.292,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[50,50],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-10.417,-2.083],[-2.083,6.25],[10.417,-6.25]],"o":[[-10.417,-2.083],[-2.083,6.25],[10.417,-6.25]],"v":[[-10.417,-2.083],[-2.083,6.25],[10.417,-6.25]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[50,50],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":2,"ty":4,"nm":"Layer 2 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[91.667,25],[91.667,75]],"o":[[91.667,25],[91.667,75]],"v":[[91.667,25],[91.667,75]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[1,0.741176470588,0.627450980392,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[8.333,25],[8.333,75]],"o":[[8.333,25],[8.333,75]],"v":[[8.333,25],[8.333,75]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[1,0.741176470588,0.627450980392,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":3,"ty":4,"nm":"Layer 1 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":10.0000004073083,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[23.45,35.778],[-23.449,35.778],[-23.449,-35.778],[23.45,-35.778]],"o":[[23.45,35.778],[-23.449,35.778],[-23.449,-35.778],[23.45,-35.778]],"v":[[23.45,35.778],[-23.449,35.778],[-23.449,-35.778],[23.45,-35.778]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"fl","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[49.611,50.415],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true}],"markers":[],"__complete":true} \ No newline at end of file diff --git a/Projects/ResourceKit/Resources/Lottie/Tab_Search.lottie b/Projects/ResourceKit/Resources/Lottie/Tab_Search.lottie new file mode 100644 index 0000000..16e8a44 --- /dev/null +++ b/Projects/ResourceKit/Resources/Lottie/Tab_Search.lottie @@ -0,0 +1 @@ +{"v":"4.8.0","meta":{"g":"LottieFiles AE 3.5.1","a":"","k":"","d":"","tc":""},"fr":29.9700012207031,"ip":0,"op":60.0000024438501,"w":100,"h":100,"nm":"icon_discover","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Layer 5 Outlines 2","parent":4,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":7,"s":[0]},{"t":15.0000006109625,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-7.723,-7.723],[6.892,-0.13600000000000012]],"o":[[0.492,-6.458],[7.724,7.723]],"v":[[-7.723,-7.723],[7.724,7.723]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6.951,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[71.316,29.475],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":2,"ty":4,"nm":"Layer 4 Outlines 2","parent":4,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[22.032,-12.168],[12.168,22.032],[-22.032,12.168],[-12.168,-22.032]],"o":[[22.032,12.168],[-12.168,22.032],[-22.032,-12.168],[12.168,-22.032]],"v":[[22.032,0],[0,22.032],[-22.032,0],[0,-22.032]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[63.592,37.448],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":3,"ty":4,"nm":"Layer 3 Outlines 2","parent":4,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[63.592,37.448,0],"ix":2},"a":{"a":0,"k":[63.592,37.448,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":15.0000006109625,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-14.929,-27.032],[27.032,-14.928],[14.929,27.032],[-27.032,14.93]],"o":[[14.929,-27.032],[27.032,14.93],[-14.929,27.032],[-27.032,-14.928]],"v":[[0,-27.032],[27.032,0.001],[0,27.032],[-27.032,0.001]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"fl","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[63.592,37.448],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":4,"ty":4,"nm":"Layer 2 Outlines 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":5,"s":[-7]},{"i":{"x":[0.667],"y":[0.813]},"o":{"x":[0.333],"y":[0]},"t":11,"s":[7]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[-0.446]},"t":18,"s":[-3]},{"t":23.0000009368092,"s":[0]}],"ix":10},"p":{"a":0,"k":[89.441,71.358,0],"ix":2},"a":{"a":0,"k":[89.441,71.358,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-6.166,-7.302],[6.166,7.302]],"o":[[-6.166,-7.302],[6.166,7.302]],"v":[[-6.166,-7.302],[6.166,7.302]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[83.275,64.056],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true},{"ddd":0,"ind":5,"ty":4,"nm":"Layer 1 Outlines 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[50,50,0],"ix":2},"a":{"a":0,"k":[50,50,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[11.458,83.577],[68.853,83.577]],"o":[[11.458,83.577],[68.853,83.577]],"v":[[11.458,83.577],[68.853,83.577]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[11.458,56.497],[28.836,56.497]],"o":[[11.458,56.497],[28.836,56.497]],"v":[[11.458,56.497],[28.836,56.497]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false,"_render":true},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[11.458,29.415],[23.043,29.415]],"o":[[11.458,29.415],[23.043,29.415]],"v":[[11.458,29.415],[23.043,29.415]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false,"_render":true},{"ty":"st","c":{"a":0,"k":[0.996078491211,0.341176470588,0.227450995352,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Group 3","np":2,"cix":2,"bm":0,"ix":3,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":60.0000024438501,"st":0,"bm":0,"completed":true}],"markers":[],"__complete":true} \ No newline at end of file From d84830b5fe4b58710bda41f5b6f285be4605661e Mon Sep 17 00:00:00 2001 From: hryeong66 Date: Thu, 8 Aug 2024 19:20:52 +0900 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20memeItemView=20spacing=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#62)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: memeItemView spacing 수정 (#62) --- .../Core/DesignSystem/Sources/View/Meme/MemeItemView.swift | 6 +++--- Projects/Features/MyPage/Sources/MyPageView.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Projects/Core/DesignSystem/Sources/View/Meme/MemeItemView.swift b/Projects/Core/DesignSystem/Sources/View/Meme/MemeItemView.swift index 2897206..3d3dcd3 100644 --- a/Projects/Core/DesignSystem/Sources/View/Meme/MemeItemView.swift +++ b/Projects/Core/DesignSystem/Sources/View/Meme/MemeItemView.swift @@ -26,13 +26,12 @@ public struct MemeItemView: View { } public var body: some View { - VStack { + VStack(spacing: 10) { MemeItemViewWithButton(memeDetail: memeDetail, memeCopyHandler: memeCopyHandler) .onTapGesture { memeClickHandler?(memeDetail) } MemeItemInfoView(memeName: memeDetail.title, reaction: memeDetail.reaction) - .padding(.top, 10) } } } @@ -119,10 +118,11 @@ struct MemeItemInfoView: View { } Spacer() } + .padding(.horizontal, 4) } var memeReactionView: some View { - HStack { + HStack(spacing: 4) { Text("ㅋㅋ") .font(Font.Family2.xlarge) Text("\(reaction)") diff --git a/Projects/Features/MyPage/Sources/MyPageView.swift b/Projects/Features/MyPage/Sources/MyPageView.swift index 9addeac..998f17d 100644 --- a/Projects/Features/MyPage/Sources/MyPageView.swift +++ b/Projects/Features/MyPage/Sources/MyPageView.swift @@ -44,7 +44,7 @@ public struct MyPageView: View { viewModel.dispatch(type: .onAppearLastMeme) } ) - Spacer(minLength: 80) + Spacer(minLength: 100) } .onAppear { viewModel.dispatch(type: .onAppearMyPageView) From abfee50c4af2179da317b6cb0b17630fe84fe640 Mon Sep 17 00:00:00 2001 From: hryeong66 Date: Sun, 11 Aug 2024 21:57:50 +0900 Subject: [PATCH 5/5] =?UTF-8?q?Etc:=20=EC=BD=94=EB=93=9C=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=20=EB=B0=98=EC=98=81=20-=20=EC=A4=91=EB=B3=B5=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B0=8F=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C=20?= =?UTF-8?q?=EB=B7=B0=20=EC=82=AD=EC=A0=9C=20(#63)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/MainTab/MainTabView.swift | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/Projects/Core/DesignSystem/Sources/MainTab/MainTabView.swift b/Projects/Core/DesignSystem/Sources/MainTab/MainTabView.swift index 57040ef..bfd0b9e 100644 --- a/Projects/Core/DesignSystem/Sources/MainTab/MainTabView.swift +++ b/Projects/Core/DesignSystem/Sources/MainTab/MainTabView.swift @@ -44,17 +44,15 @@ public struct TabItemView: View { @State var playbackMode: LottiePlaybackMode = .paused(at: .progress(100)) @State var isAnimationFinished: Bool = false - var tabImage: Image { - return isSelected ? tab.selectedImage : tab.image - } - var color: SwiftUI.Color { return isSelected ? Color.Text.brand : Color.Text.assistive } public var body: some View { VStack { - tabImageView + tabItemImageView + .frame(width: 24, height: 24) + .padding(.bottom, 6) Text(tab.title) .font(Font.Weight.medium) } @@ -62,26 +60,32 @@ public struct TabItemView: View { .padding(40) } - var tabImageView: some View { - ZStack { - if !isAnimationFinished && isSelected { - LottieView(animation: tab.lottieAnimation) - .playing() - .animationDidFinish { _ in - isAnimationFinished = true - } - .resizable() - .frame(width: 24, height: 24) - } else { - tabImage - .resizable() - .frame(width: 24, height: 24) - - } - } - .padding(.bottom, 6) + var needPlayLottieView: Bool { + return !isAnimationFinished && isSelected + } + + var tabItemImageView: some View { + needPlayLottieView ? tabLottieView : tabImageView } - + + var tabLottieView: AnyView { + AnyView( + LottieView(animation: tab.lottieAnimation) + .playing() + .animationDidFinish { _ in + isAnimationFinished = true + } + .resizable() + ) + } + + var tabImageView: AnyView { + AnyView( + (isSelected ? tab.selectedImage : tab.image) + .resizable() + ) + } + } struct TabBarModifier: ViewModifier {