From d4825ab47e1b983946ef2250adc401f4bf518719 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 18:45:28 +0900 Subject: [PATCH 01/22] =?UTF-8?q?chore:=20InfoPlist=20kakaoTalk=20Scheme?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift b/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift index 0e81bb24..2678b7c0 100644 --- a/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift +++ b/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift @@ -25,7 +25,7 @@ public extension InfoPlist { "BASE_URL": "$(BASE_URL)", "WEB_VIEW_BASE_URL": "$(WEB_VIEW_BASE_URL)", "WEB_VIEW_MESSAGE_HANDLER_DEFAULT_NAME": "$(WEB_VIEW_MESSAGE_HANDLER_DEFAULT_NAME)", - "LSApplicationQueriesSchemes": ["kakaokompassauth"], + "LSApplicationQueriesSchemes": ["kakaokompassauth", "kakaotalk"], "CFBundleURLTypes": [ [ "CFBundleTypeRole": "Editor", @@ -49,7 +49,7 @@ public extension InfoPlist { "BASE_URL": "$(BASE_URL)", "WEB_VIEW_BASE_URL": "$(WEB_VIEW_BASE_URL)", "WEB_VIEW_MESSAGE_HANDLER_DEFAULT_NAME": "$(WEB_VIEW_MESSAGE_HANDLER_DEFAULT_NAME)", - "LSApplicationQueriesSchemes": ["kakaokompassauth"], + "LSApplicationQueriesSchemes": ["kakaokompassauth", "kakaotalk"], "CFBundleURLTypes": [ [ "CFBundleTypeRole": "Editor", From 45f7633281b2b12b2ff6dd6410982295a5194c00 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 18:46:19 +0900 Subject: [PATCH 02/22] =?UTF-8?q?feat:=20=EC=B9=B4=EC=B9=B4=EC=98=A4?= =?UTF-8?q?=ED=86=A1=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C?= =?UTF-8?q?=20=EC=95=B1=20=EC=97=B4=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/SubViews/Matching/MatchingView.swift | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/Matching/MatchingView.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/Matching/MatchingView.swift index 26f248b1..da416243 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/Matching/MatchingView.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/Matching/MatchingView.swift @@ -175,7 +175,13 @@ private extension MatchingView { case .waiting: EmptyView() case .success: - EmptyView() + SolidButton( + title: "카카오톡 바로가기", + sizeType: .large, + buttonType: .throttle, + action: { openKakaoTalk() } + ) + case .failure: SolidButton( title: "다른 보틀 열어보기", @@ -242,3 +248,12 @@ private extension MatchingView { .padding(.bottom, 32.0) } } + +private extension MatchingView { + // TODO: 추후 구조 변경 필요 + func openKakaoTalk() { + let kakaoTalk = "kakaotalk://" + guard let kakaoTalkURL = NSURL(string: kakaoTalk) as? URL, UIApplication.shared.canOpenURL(kakaoTalkURL) else { return } + UIApplication.shared.open(kakaoTalkURL) + } +} From f562e38f58e0bc0d809668e4a269a4d1d5acf2d2 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 18:58:11 +0900 Subject: [PATCH 03/22] =?UTF-8?q?refactor:=20Environment=20openURL?= =?UTF-8?q?=EC=9D=84=20=ED=86=B5=ED=95=B4=20=EC=B9=B4=EC=B9=B4=EC=98=A4?= =?UTF-8?q?=ED=86=A1=20=EC=97=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PingPongDetail/View/SubViews/Matching/MatchingView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/Matching/MatchingView.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/Matching/MatchingView.swift index da416243..ad0d259a 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/Matching/MatchingView.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/Matching/MatchingView.swift @@ -13,6 +13,7 @@ import ComposableArchitecture public struct MatchingView: View { @Perception.Bindable private var store: StoreOf + @Environment(\.openURL) var openURL public init(store: StoreOf) { self.store = store @@ -253,7 +254,7 @@ private extension MatchingView { // TODO: 추후 구조 변경 필요 func openKakaoTalk() { let kakaoTalk = "kakaotalk://" - guard let kakaoTalkURL = NSURL(string: kakaoTalk) as? URL, UIApplication.shared.canOpenURL(kakaoTalkURL) else { return } - UIApplication.shared.open(kakaoTalkURL) + guard let kakaoTalkURL = NSURL(string: kakaoTalk) as? URL else { return } + openURL(kakaoTalkURL) } } From 147fcdfdea113bd9941e90cad1359b7a9095d44e Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Thu, 22 Aug 2024 21:03:35 +0900 Subject: [PATCH 04/22] =?UTF-8?q?chore:=20Feature=20Guide=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectDescriptionHelpers/Modules.swift | 1 + .../Guide/Example/Sources/AppView.swift | 11 ++++ .../Interface/Sources/GuideRootFeature.swift | 32 ++++++++++++ .../Interface/Sources/GuideRootView.swift | 17 ++++++ Projects/Feature/Guide/Project.swift | 52 +++++++++++++++++++ Projects/Feature/Guide/Sources/Source.swift | 1 + .../Guide/Testing/Sources/GuideTesting.swift | 1 + .../Guide/Tests/Sources/GuideTest.swift | 11 ++++ 8 files changed, 126 insertions(+) create mode 100644 Projects/Feature/Guide/Example/Sources/AppView.swift create mode 100644 Projects/Feature/Guide/Interface/Sources/GuideRootFeature.swift create mode 100644 Projects/Feature/Guide/Interface/Sources/GuideRootView.swift create mode 100644 Projects/Feature/Guide/Project.swift create mode 100644 Projects/Feature/Guide/Sources/Source.swift create mode 100644 Projects/Feature/Guide/Testing/Sources/GuideTesting.swift create mode 100644 Projects/Feature/Guide/Tests/Sources/GuideTest.swift diff --git a/Plugins/DependencyPlugin/ProjectDescriptionHelpers/Modules.swift b/Plugins/DependencyPlugin/ProjectDescriptionHelpers/Modules.swift index 9f4730b8..254f6512 100644 --- a/Plugins/DependencyPlugin/ProjectDescriptionHelpers/Modules.swift +++ b/Plugins/DependencyPlugin/ProjectDescriptionHelpers/Modules.swift @@ -27,6 +27,7 @@ public extension ModulePath { // MARK: - FeatureModule public extension ModulePath { enum Feature: String, CaseIterable { + case Guide case TabBar case Report case BottleArrival diff --git a/Projects/Feature/Guide/Example/Sources/AppView.swift b/Projects/Feature/Guide/Example/Sources/AppView.swift new file mode 100644 index 00000000..5411b88e --- /dev/null +++ b/Projects/Feature/Guide/Example/Sources/AppView.swift @@ -0,0 +1,11 @@ +import SwiftUI + +@main +struct AppView: App { + var body: some Scene { + WindowGroup { + Text("Hello Tuist!") + } + } +} + diff --git a/Projects/Feature/Guide/Interface/Sources/GuideRootFeature.swift b/Projects/Feature/Guide/Interface/Sources/GuideRootFeature.swift new file mode 100644 index 00000000..71e92dd3 --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/GuideRootFeature.swift @@ -0,0 +1,32 @@ +// +// GuideRootFeature.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/22/24. +// + +import Foundation + +import ComposableArchitecture + +@Reducer +public struct GuideRootFeature { + + private let reducer: Reduce + + public init(reducer: Reduce) { + self.reducer = reducer + } + + public struct State: Equatable { + + } + + public enum Action { + + } + + public var body: some ReducerOf { + reducer + } +} diff --git a/Projects/Feature/Guide/Interface/Sources/GuideRootView.swift b/Projects/Feature/Guide/Interface/Sources/GuideRootView.swift new file mode 100644 index 00000000..593beea2 --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/GuideRootView.swift @@ -0,0 +1,17 @@ +// +// GuideRootView.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/22/24. +// + +import SwiftUI + +import ComposableArchitecture + +public struct GuideRootView: View { + public init() {} + public var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} diff --git a/Projects/Feature/Guide/Project.swift b/Projects/Feature/Guide/Project.swift new file mode 100644 index 00000000..97997de9 --- /dev/null +++ b/Projects/Feature/Guide/Project.swift @@ -0,0 +1,52 @@ +import ProjectDescription +import ProjectDescriptionHelpers +import DependencyPlugin + +let project = Project.makeModule( + name: ModulePath.Feature.name+ModulePath.Feature.Guide.rawValue, + targets: [ + .feature( + interface: .Guide, + factory: .init(dependencies: [ + .core + ]) + ), + .feature( + implements: .Guide, + factory: .init( + dependencies: [ + .feature(interface: .Guide) + ] + ) + ), + + .feature( + testing: .Guide, + factory: .init( + dependencies: [ + .feature(interface: .Guide) + ] + ) + ), + .feature( + tests: .Guide, + factory: .init( + dependencies: [ + .feature(testing: .Guide), + .feature(implements: .Guide) + ] + ) + ), + + .feature( + example: .Guide, + factory: .init( + dependencies: [ + .feature(testing: .Guide), + .feature(implements: .Guide) + ] + ) + ) + + ] +) diff --git a/Projects/Feature/Guide/Sources/Source.swift b/Projects/Feature/Guide/Sources/Source.swift new file mode 100644 index 00000000..b1853ce6 --- /dev/null +++ b/Projects/Feature/Guide/Sources/Source.swift @@ -0,0 +1 @@ +// This is for Tuist diff --git a/Projects/Feature/Guide/Testing/Sources/GuideTesting.swift b/Projects/Feature/Guide/Testing/Sources/GuideTesting.swift new file mode 100644 index 00000000..b1853ce6 --- /dev/null +++ b/Projects/Feature/Guide/Testing/Sources/GuideTesting.swift @@ -0,0 +1 @@ +// This is for Tuist diff --git a/Projects/Feature/Guide/Tests/Sources/GuideTest.swift b/Projects/Feature/Guide/Tests/Sources/GuideTest.swift new file mode 100644 index 00000000..b3cdf63c --- /dev/null +++ b/Projects/Feature/Guide/Tests/Sources/GuideTest.swift @@ -0,0 +1,11 @@ +import XCTest + +final class GuideTests: XCTestCase { + override func setUpWithError() throws {} + + override func tearDownWithError() throws {} + + func testExample() { + XCTAssertEqual(1, 1) + } +} From cca186c1df7ee357581bc5cd266c7229b46a201d Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Thu, 22 Aug 2024 22:03:20 +0900 Subject: [PATCH 05/22] =?UTF-8?q?chore:=20Guide=20image=20Assets=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Contents.json | 12 ++++++++++ .../illustraition_bottleArrivalPhone.svg | 22 +++++++++++++++++++ .../Contents.json | 12 ++++++++++ .../illustraition_photoShare.svg | 21 ++++++++++++++++++ .../Contents.json | 12 ++++++++++ .../illustration_firstPingPong.svg | 9 ++++++++ .../Contents.json | 12 ++++++++++ .../illustration_secondPingPong.svg | 21 ++++++++++++++++++ .../BottleImageSystem+Illustraition.swift | 12 ++++++++++ 9 files changed, 133 insertions(+) create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/Contents.json create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/illustraition_bottleArrivalPhone.svg create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/Contents.json create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/illustraition_photoShare.svg create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/Contents.json create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/illustration_firstPingPong.svg create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/Contents.json create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/illustration_secondPingPong.svg diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/Contents.json b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/Contents.json new file mode 100644 index 00000000..8e437b1a --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "illustraition_bottleArrivalPhone.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/illustraition_bottleArrivalPhone.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/illustraition_bottleArrivalPhone.svg new file mode 100644 index 00000000..a3daf377 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/illustraition_bottleArrivalPhone.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/Contents.json b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/Contents.json new file mode 100644 index 00000000..9eb2c884 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "illustraition_photoShare.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/illustraition_photoShare.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/illustraition_photoShare.svg new file mode 100644 index 00000000..934ef767 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/illustraition_photoShare.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/Contents.json b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/Contents.json new file mode 100644 index 00000000..ee62652e --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "illustration_firstPingPong.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/illustration_firstPingPong.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/illustration_firstPingPong.svg new file mode 100644 index 00000000..f72965bc --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/illustration_firstPingPong.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/Contents.json b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/Contents.json new file mode 100644 index 00000000..4eb343c9 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "illustration_secondPingPong.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/illustration_secondPingPong.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/illustration_secondPingPong.svg new file mode 100644 index 00000000..752b0d51 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/illustration_secondPingPong.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Projects/Shared/DesignSystem/Sources/Image/BottleImageSystem+Illustraition.swift b/Projects/Shared/DesignSystem/Sources/Image/BottleImageSystem+Illustraition.swift index 2ec540a4..e3db6af1 100644 --- a/Projects/Shared/DesignSystem/Sources/Image/BottleImageSystem+Illustraition.swift +++ b/Projects/Shared/DesignSystem/Sources/Image/BottleImageSystem+Illustraition.swift @@ -26,6 +26,10 @@ public extension Image.BottleImageSystem { case phone case basket case splash + case firstPingPong + case secondPingPong + case photoShare + case bottleArrivalPhone } } @@ -66,6 +70,14 @@ public extension Image.BottleImageSystem.Illustraition { return SharedDesignSystemAsset.Images.illustraitionBasket.swiftUIImage case .splash: return SharedDesignSystemAsset.Images.imageSplash.swiftUIImage + case .firstPingPong: + return SharedDesignSystemAsset.Images.illustrationFirstPingPong.swiftUIImage + case .secondPingPong: + return SharedDesignSystemAsset.Images.illustrationSecondPingPong.swiftUIImage + case .photoShare: + return SharedDesignSystemAsset.Images.illustraitionPhotoShare.swiftUIImage + case .bottleArrivalPhone: + return SharedDesignSystemAsset.Images.illustraitionBottleArrivalPhone.swiftUIImage } } } From d06c56c82735833a5f51ef108df93173a703ad46 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Thu, 22 Aug 2024 23:02:12 +0900 Subject: [PATCH 06/22] =?UTF-8?q?feat:=20=EC=B2=AB=EB=B2=88=EC=A8=B0=20Gui?= =?UTF-8?q?de=20=ED=99=94=EB=A9=B4=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interface/Sources/GuideRootFeature.swift | 32 ---------- .../Interface/Sources/GuideRootView.swift | 17 ----- .../Sources/MainGuide/MainGuideFeature.swift | 48 ++++++++++++++ .../Sources/MainGuide/MainGuideView.swift | 63 +++++++++++++++++++ 4 files changed, 111 insertions(+), 49 deletions(-) delete mode 100644 Projects/Feature/Guide/Interface/Sources/GuideRootFeature.swift delete mode 100644 Projects/Feature/Guide/Interface/Sources/GuideRootView.swift create mode 100644 Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideFeature.swift create mode 100644 Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift diff --git a/Projects/Feature/Guide/Interface/Sources/GuideRootFeature.swift b/Projects/Feature/Guide/Interface/Sources/GuideRootFeature.swift deleted file mode 100644 index 71e92dd3..00000000 --- a/Projects/Feature/Guide/Interface/Sources/GuideRootFeature.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// GuideRootFeature.swift -// FeatureGuideInterface -// -// Created by 임현규 on 8/22/24. -// - -import Foundation - -import ComposableArchitecture - -@Reducer -public struct GuideRootFeature { - - private let reducer: Reduce - - public init(reducer: Reduce) { - self.reducer = reducer - } - - public struct State: Equatable { - - } - - public enum Action { - - } - - public var body: some ReducerOf { - reducer - } -} diff --git a/Projects/Feature/Guide/Interface/Sources/GuideRootView.swift b/Projects/Feature/Guide/Interface/Sources/GuideRootView.swift deleted file mode 100644 index 593beea2..00000000 --- a/Projects/Feature/Guide/Interface/Sources/GuideRootView.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// GuideRootView.swift -// FeatureGuideInterface -// -// Created by 임현규 on 8/22/24. -// - -import SwiftUI - -import ComposableArchitecture - -public struct GuideRootView: View { - public init() {} - public var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) - } -} diff --git a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideFeature.swift b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideFeature.swift new file mode 100644 index 00000000..33e1c63f --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideFeature.swift @@ -0,0 +1,48 @@ +// +// MainGuideFeature.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/22/24. +// + +import Foundation + +import ComposableArchitecture + +@Reducer +public struct MainGuideFeature { + private let reducer: Reduce + + init(reducer: Reduce) { + self.reducer = reducer + } + + public struct State: Equatable { + public init() {} + } + + public enum Action { + case nextButtonDidTapped + case backButtonDidTapped + } + + public var body: some ReducerOf { + reducer + } +} + +extension MainGuideFeature { + public init() { + let reducer = Reduce { state, action in + switch action { + case .nextButtonDidTapped: + return .none + + case .backButtonDidTapped: + return .none + } + } + + self.init(reducer: reducer) + } +} diff --git a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift new file mode 100644 index 00000000..c159717b --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift @@ -0,0 +1,63 @@ +// +// MainGuideView.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/22/24. +// + +import SwiftUI + +import SharedDesignSystem + +import ComposableArchitecture + +public struct MainGuideView: View { + private let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + VStack(spacing: 0) { + title + bottleArrivalImage + nextButton + } + .padding(.top, .xl) + .padding(.horizontal, .md) + .setNavigationBar { + makeNaivgationleftButton { + store.send(.backButtonDidTapped) + } + } + } +} + +private extension MainGuideView { + var title: some View { + TitleView( + pageInfo: PageInfo(nowPage: 1, totalCount: 5), + title: "천천히 서로를 알아가는 소개팅\n보틀에 오신 것을 환영해요" + ) + } + + var bottleArrivalImage: some View { + BottleImageView(type: + .local(bottleImageSystem: .illustraition(.bottleArrivalPhone)) + ) + .clipped() + .padding(.top, 48) + } + + var nextButton: some View { + SolidButton( + title: "다음", + sizeType: .large, + buttonType: .throttle, + action: { store.send(.nextButtonDidTapped) } + ) + .shadow(color: .white, radius: 30, y: -30) + + } +} From 162cc4102bdd3546daad7729299120094a5ed78d Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 14:21:39 +0900 Subject: [PATCH 07/22] =?UTF-8?q?chore:=20Guide=20ImageAssets=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../illustraition_bottleArrivalPhone.svg | 23 ++++--------------- .../Contents.json | 2 +- .../illustraition_firstPingPong.svg | 9 ++++++++ .../illustraition_photoShare.svg | 22 ++++-------------- .../Contents.json | 2 +- .../illustraition_secondPingPong.svg | 9 ++++++++ .../illustration_firstPingPong.svg | 9 -------- .../illustration_secondPingPong.svg | 21 ----------------- .../BottleImageSystem+Illustraition.swift | 4 ++-- 9 files changed, 32 insertions(+), 69 deletions(-) rename Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/{illustration_firstPingPong.imageset => illustraition_firstPingPong.imageset}/Contents.json (69%) create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_firstPingPong.imageset/illustraition_firstPingPong.svg rename Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/{illustration_secondPingPong.imageset => illustraition_secondPingPong.imageset}/Contents.json (69%) create mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_secondPingPong.imageset/illustraition_secondPingPong.svg delete mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/illustration_firstPingPong.svg delete mode 100644 Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/illustration_secondPingPong.svg diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/illustraition_bottleArrivalPhone.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/illustraition_bottleArrivalPhone.svg index a3daf377..9a50b810 100644 --- a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/illustraition_bottleArrivalPhone.svg +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_bottleArrivalPhone.imageset/illustraition_bottleArrivalPhone.svg @@ -1,22 +1,9 @@ - - - - - + + - - - - - - - - - - - - + + - + diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/Contents.json b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_firstPingPong.imageset/Contents.json similarity index 69% rename from Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/Contents.json rename to Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_firstPingPong.imageset/Contents.json index ee62652e..1b821574 100644 --- a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/Contents.json +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_firstPingPong.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "illustration_firstPingPong.svg", + "filename" : "illustraition_firstPingPong.svg", "idiom" : "universal" } ], diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_firstPingPong.imageset/illustraition_firstPingPong.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_firstPingPong.imageset/illustraition_firstPingPong.svg new file mode 100644 index 00000000..5b812454 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_firstPingPong.imageset/illustraition_firstPingPong.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/illustraition_photoShare.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/illustraition_photoShare.svg index 934ef767..326442fc 100644 --- a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/illustraition_photoShare.svg +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_photoShare.imageset/illustraition_photoShare.svg @@ -1,21 +1,9 @@ - - - - + + - - - - - - - - - - - - + + - + diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/Contents.json b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_secondPingPong.imageset/Contents.json similarity index 69% rename from Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/Contents.json rename to Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_secondPingPong.imageset/Contents.json index 4eb343c9..ab1fd8fa 100644 --- a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/Contents.json +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_secondPingPong.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "illustration_secondPingPong.svg", + "filename" : "illustraition_secondPingPong.svg", "idiom" : "universal" } ], diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_secondPingPong.imageset/illustraition_secondPingPong.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_secondPingPong.imageset/illustraition_secondPingPong.svg new file mode 100644 index 00000000..4d14d9a4 --- /dev/null +++ b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustraition_secondPingPong.imageset/illustraition_secondPingPong.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/illustration_firstPingPong.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/illustration_firstPingPong.svg deleted file mode 100644 index f72965bc..00000000 --- a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_firstPingPong.imageset/illustration_firstPingPong.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/illustration_secondPingPong.svg b/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/illustration_secondPingPong.svg deleted file mode 100644 index 752b0d51..00000000 --- a/Projects/Shared/DesignSystem/Resources/Images.xcassets/illustration/illustration_secondPingPong.imageset/illustration_secondPingPong.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/Projects/Shared/DesignSystem/Sources/Image/BottleImageSystem+Illustraition.swift b/Projects/Shared/DesignSystem/Sources/Image/BottleImageSystem+Illustraition.swift index e3db6af1..b7bad9ea 100644 --- a/Projects/Shared/DesignSystem/Sources/Image/BottleImageSystem+Illustraition.swift +++ b/Projects/Shared/DesignSystem/Sources/Image/BottleImageSystem+Illustraition.swift @@ -71,9 +71,9 @@ public extension Image.BottleImageSystem.Illustraition { case .splash: return SharedDesignSystemAsset.Images.imageSplash.swiftUIImage case .firstPingPong: - return SharedDesignSystemAsset.Images.illustrationFirstPingPong.swiftUIImage + return SharedDesignSystemAsset.Images.illustraitionFirstPingPong.swiftUIImage case .secondPingPong: - return SharedDesignSystemAsset.Images.illustrationSecondPingPong.swiftUIImage + return SharedDesignSystemAsset.Images.illustraitionSecondPingPong.swiftUIImage case .photoShare: return SharedDesignSystemAsset.Images.illustraitionPhotoShare.swiftUIImage case .bottleArrivalPhone: From 1356b25c7c4762281820488e08684f24786f0106 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 14:41:33 +0900 Subject: [PATCH 08/22] =?UTF-8?q?feat:=20MianGuideView=20bottleArrivalImag?= =?UTF-8?q?e=20=EB=B9=84=EC=9C=A8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/MainGuide/MainGuideView.swift | 48 +++++++++++++------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift index c159717b..854f7238 100644 --- a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift @@ -19,10 +19,25 @@ public struct MainGuideView: View { } public var body: some View { + VStack(spacing: 0) { title - bottleArrivalImage - nextButton + ZStack(alignment: .bottom) { + GeometryReader { geometry in + HStack(spacing: 0) { + Spacer() + bottleArrivalImage + .aspectRatio(contentMode: .fill) + .frame(width: geometry.size.width - 72) + .clipped() + .offset(y: 48) + Spacer() + } + } + nextButton + .padding(.bottom, .lg) + .background(to: ColorToken.container(.primary)) + } } .padding(.top, .xl) .padding(.horizontal, .md) @@ -37,8 +52,8 @@ public struct MainGuideView: View { private extension MainGuideView { var title: some View { TitleView( - pageInfo: PageInfo(nowPage: 1, totalCount: 5), - title: "천천히 서로를 알아가는 소개팅\n보틀에 오신 것을 환영해요" + pageInfo: PageInfo(nowPage: 1, totalCount: 4), + title: "천천히 서로를 알아가는 소개팅\n보틀에 오신 것을 환영해요!" ) } @@ -46,18 +61,23 @@ private extension MainGuideView { BottleImageView(type: .local(bottleImageSystem: .illustraition(.bottleArrivalPhone)) ) - .clipped() - .padding(.top, 48) + .clipShape(RoundedRectangle(cornerRadius: 30)) + .overlay( + RoundedRectangle(cornerRadius: 30) + .strokeBorder( + ColorToken.text(.primary).color, + lineWidth: 10 + ) + ) } var nextButton: some View { - SolidButton( - title: "다음", - sizeType: .large, - buttonType: .throttle, - action: { store.send(.nextButtonDidTapped) } - ) - .shadow(color: .white, radius: 30, y: -30) - + SolidButton( + title: "다음", + sizeType: .large, + buttonType: .throttle, + action: { store.send(.nextButtonDidTapped) } + ) + .shadow(color: .white, radius: 15, y: -30) } } From 8f970fe1d48aa08309e3d6d211966812bd620005 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 14:41:47 +0900 Subject: [PATCH 09/22] =?UTF-8?q?feat:=20PingPongGuideView=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PingPongGuide/PingPongGuideFeature.swift | 48 ++++++++++ .../PingPongGuide/PingPongGuideView.swift | 89 +++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideFeature.swift create mode 100644 Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift diff --git a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideFeature.swift b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideFeature.swift new file mode 100644 index 00000000..c1c5733f --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideFeature.swift @@ -0,0 +1,48 @@ +// +// PingPongGuideFeature.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/22/24. +// + +import Foundation + +import ComposableArchitecture + +@Reducer +public struct PingPongGuideFeature { + private let reducer: Reduce + + init(reducer: Reduce) { + self.reducer = reducer + } + + public struct State: Equatable { + public init() {} + } + + public enum Action { + case nextButtonDidTapped + case backButtonDidTapped + } + + public var body: some ReducerOf { + reducer + } +} + +extension PingPongGuideFeature { + public init() { + let reducer = Reduce { state, action in + switch action { + case .nextButtonDidTapped: + return .none + + case .backButtonDidTapped: + return .none + } + } + + self.init(reducer: reducer) + } +} diff --git a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift new file mode 100644 index 00000000..23c463f6 --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift @@ -0,0 +1,89 @@ +// +// PingPongGuideView.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/22/24. +// + +import SwiftUI + +import SharedDesignSystem + +import ComposableArchitecture + +public struct PingPongGuideView: View { + private let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + VStack(spacing: 0) { + title + ZStack(alignment: .bottom) { + GeometryReader { geometry in + + HStack(spacing: 0) { + Spacer() + VStack(spacing: 10) { + firstPingPongImage + .aspectRatio(contentMode: .fit) + .frame(width: geometry.size.width - 70) + .clipped() + secondPingPongImage + .aspectRatio(contentMode: .fit) + .frame(width: geometry.size.width - 55) + .clipped() + } + Spacer() + } + .offset(y: 48) + } + nextButton + .padding(.bottom, .lg) + .background(to: ColorToken.container(.primary)) + } + .border(.red) + } + .padding(.top, .xl) + .padding(.horizontal, .md) + .setNavigationBar { + makeNaivgationleftButton { + store.send(.backButtonDidTapped) + } + } + } +} + +private extension PingPongGuideView { + var title: some View { + TitleView( + pageInfo: PageInfo(nowPage: 2, totalCount: 4), + title: "보틀만의 가지관 문답을 통해\n진솔한 모습을 확인할 수 있어요" + ) + } + + var firstPingPongImage: some View { + BottleImageView(type: + .local(bottleImageSystem: .illustraition(.firstPingPong)) + ) + } + + var secondPingPongImage: some View { + BottleImageView(type: + .local(bottleImageSystem: .illustraition(.secondPingPong)) + ) + } + + var nextButton: some View { + SolidButton( + title: "다음", + sizeType: .large, + buttonType: .throttle, + action: { store.send(.nextButtonDidTapped) } + ) + .shadow(color: .white, radius: 15, y: -30) + + } +} From 752019859567c6106bebdebe5d87a3f6013975be Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 15:12:10 +0900 Subject: [PATCH 10/22] =?UTF-8?q?feat:=20PhotoShareGuideView=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PhotoShareGuideFeature.swift | 48 +++++++++ .../PhotoShareGuide/PhotoShareGuideView.swift | 101 ++++++++++++++++++ 2 files changed, 149 insertions(+) create mode 100644 Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideFeature.swift create mode 100644 Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift diff --git a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideFeature.swift b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideFeature.swift new file mode 100644 index 00000000..0e66d85b --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideFeature.swift @@ -0,0 +1,48 @@ +// +// PhotoShareGuideFeature.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/23/24. +// + +import Foundation + +import ComposableArchitecture + +@Reducer +public struct PhotoShareGuideFeature { + private let reducer: Reduce + + init(reducer: Reduce) { + self.reducer = reducer + } + + public struct State: Equatable { + public init() {} + } + + public enum Action { + case nextButtonDidTapped + case backButtonDidTapped + } + + public var body: some ReducerOf { + reducer + } +} + +extension PhotoShareGuideFeature { + public init() { + let reducer = Reduce { state, action in + switch action { + case .nextButtonDidTapped: + return .none + + case .backButtonDidTapped: + return .none + } + } + + self.init(reducer: reducer) + } +} diff --git a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift new file mode 100644 index 00000000..30f787d5 --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift @@ -0,0 +1,101 @@ +// +// PhotoShareGuideView.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/23/24. +// + +import SwiftUI + +import SharedDesignSystem + +import ComposableArchitecture + +public struct PhotoShareGuideView: View { + private let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + VStack(spacing: 0) { + title + .padding(.horizontal, .md) + ZStack(alignment: .bottom) { + GeometryReader { geometry in + + VStack(spacing: 0) { + HStack(spacing: 0) { + girlImage + .aspectRatio(contentMode: .fit) + .clipped() + Spacer() + .frame(width: 12) + + boyImage + .aspectRatio(contentMode: .fit) + .clipped() + } + + photoShareImage + .aspectRatio(contentMode: .fit) + .frame(width: geometry.size.width - 100) + .clipped() + .offset(y: -85) + } + .offset(y: 48) + } + nextButton + .padding(.bottom, .lg) + .padding(.horizontal, .md) + .background(to: ColorToken.container(.primary)) + } + } + .padding(.top, .xl) + .setNavigationBar { + makeNaivgationleftButton { + store.send(.backButtonDidTapped) + } + } + } +} + +private extension PhotoShareGuideView { + var title: some View { + TitleView( + pageInfo: PageInfo(nowPage: 3, totalCount: 4), + title: "확신이 생겼다면\n사진과 연락처를 주고 받아 보세요" + ) + } + + var girlImage: some View { + BottleImageView(type: + .local(bottleImageSystem: .illustraition(.girl)) + ) + .cornerRadius(.md, corenrs: [.topRight]) + } + + var boyImage: some View { + BottleImageView(type: + .local(bottleImageSystem: .illustraition(.boy)) + ) + .cornerRadius(.md, corenrs: [.topLeft]) + } + + var photoShareImage: some View { + BottleImageView(type: + .local(bottleImageSystem: .illustraition(.photoShare)) + ) + } + + var nextButton: some View { + SolidButton( + title: "다음", + sizeType: .large, + buttonType: .throttle, + action: { store.send(.nextButtonDidTapped) } + ) + .shadow(color: .white, radius: 15, y: -30) + } +} From 61fe951dc9159d88ca2257b2671ae09efe032ee0 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 15:19:15 +0900 Subject: [PATCH 11/22] =?UTF-8?q?feat:=20StartGuideView=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PingPongGuide/PingPongGuideView.swift | 1 - .../StartGuide/StartGuideFeature.swift | 48 ++++++++++++ .../Sources/StartGuide/StartGuideView.swift | 74 +++++++++++++++++++ 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideFeature.swift create mode 100644 Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift diff --git a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift index 23c463f6..1eb5b6c8 100644 --- a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift @@ -44,7 +44,6 @@ public struct PingPongGuideView: View { .padding(.bottom, .lg) .background(to: ColorToken.container(.primary)) } - .border(.red) } .padding(.top, .xl) .padding(.horizontal, .md) diff --git a/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideFeature.swift b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideFeature.swift new file mode 100644 index 00000000..0b4b6856 --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideFeature.swift @@ -0,0 +1,48 @@ +// +// StartGuideFeature.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/23/24. +// + +import Foundation + +import ComposableArchitecture + +@Reducer +public struct StartGuideFeature { + private let reducer: Reduce + + init(reducer: Reduce) { + self.reducer = reducer + } + + public struct State: Equatable { + public init() {} + } + + public enum Action { + case doneButtonDidTapped + case backButtonDidTapped + } + + public var body: some ReducerOf { + reducer + } +} + +extension StartGuideFeature { + public init() { + let reducer = Reduce { state, action in + switch action { + case .doneButtonDidTapped: + return .none + + case .backButtonDidTapped: + return .none + } + } + + self.init(reducer: reducer) + } +} diff --git a/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift new file mode 100644 index 00000000..efd1ac96 --- /dev/null +++ b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift @@ -0,0 +1,74 @@ +// +// StartGuideView.swift +// FeatureGuideInterface +// +// Created by 임현규 on 8/23/24. +// + +import SwiftUI + +import SharedDesignSystem + +import ComposableArchitecture + +public struct StartGuideView: View { + private let store: StoreOf + + public init(store: StoreOf) { + self.store = store + } + + public var body: some View { + VStack(spacing: 0) { + title + ZStack(alignment: .bottom) { + GeometryReader { geometry in + + HStack(spacing: 0) { + Spacer() + bottleImage + .scaledToFit() + Spacer() + } + .offset(y: 48) + } + doneButton + .padding(.bottom, .lg) + .background(to: ColorToken.container(.primary)) + } + } + .padding(.top, .xl) + .padding(.horizontal, .md) + .setNavigationBar { + makeNaivgationleftButton { + store.send(.backButtonDidTapped) + } + } + } +} + +private extension StartGuideView { + var title: some View { + TitleView( + pageInfo: PageInfo(nowPage: 4, totalCount: 4), + title: "설레는 여정\n보틀과 함께 시작해 볼까요?" + ) + } + + var bottleImage: some View { + BottleImageView(type: + .local(bottleImageSystem: .illustraition(.bottle2)) + ) + } + + var doneButton: some View { + SolidButton( + title: "완료", + sizeType: .large, + buttonType: .throttle, + action: { store.send(.doneButtonDidTapped) } + ) + .shadow(color: .white, radius: 15, y: -30) + + } +} From 087fcc75175a35083aa06b27dc0e2945dde14d11 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 16:27:19 +0900 Subject: [PATCH 12/22] =?UTF-8?q?feat:=20=ED=9A=8C=EC=9B=90=EA=B0=80?= =?UTF-8?q?=EC=9E=85=20=EC=95=88=ED=95=9C=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?GuideView=20=EB=B3=B4=EC=97=AC=EC=A3=BC=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Guide/Example/Sources/AppView.swift | 26 ++++++++++- .../Sources/MainGuide/MainGuideFeature.swift | 17 ++++++- .../Sources/MainGuide/MainGuideView.swift | 3 +- .../PhotoShareGuideFeature.swift | 17 ++++++- .../PhotoShareGuide/PhotoShareGuideView.swift | 2 +- .../PingPongGuide/PingPongGuideFeature.swift | 17 ++++++- .../PingPongGuide/PingPongGuideView.swift | 5 +- .../StartGuide/StartGuideFeature.swift | 17 ++++++- .../Sources/StartGuide/StartGuideView.swift | 1 + Projects/Feature/Guide/Sources/Source.swift | 1 - Projects/Feature/Guide/Sources/Sources.swift | 8 ++++ .../Sources/Login/LoginFeature.swift | 46 ++++++++++++++++++- .../Sources/Login/LoginFeatureInterface.swift | 1 + .../Interface/Sources/Login/LoginView.swift | 28 ++++++++++- Projects/Feature/Login/Project.swift | 3 +- 15 files changed, 177 insertions(+), 15 deletions(-) delete mode 100644 Projects/Feature/Guide/Sources/Source.swift create mode 100644 Projects/Feature/Guide/Sources/Sources.swift diff --git a/Projects/Feature/Guide/Example/Sources/AppView.swift b/Projects/Feature/Guide/Example/Sources/AppView.swift index 5411b88e..22c8fed2 100644 --- a/Projects/Feature/Guide/Example/Sources/AppView.swift +++ b/Projects/Feature/Guide/Example/Sources/AppView.swift @@ -1,10 +1,34 @@ import SwiftUI +import FeatureGuideInterface + +import ComposableArchitecture + @main struct AppView: App { + let mainGuideStore = Store( + initialState: MainGuideFeature.State(), + reducer: { MainGuideFeature() }) + + let pingpongGuideStore = Store( + initialState: PingPongGuideFeature.State(), + reducer: { PingPongGuideFeature() }) + + let photoShareGuideStore = Store( + initialState: PhotoShareGuideFeature.State(), + reducer: { PhotoShareGuideFeature() }) + + let startGuideStore = Store( + initialState: StartGuideFeature.State(), + reducer: { StartGuideFeature() }) + var body: some Scene { + WindowGroup { - Text("Hello Tuist!") +// MainGuideView(store: mainGuideStore) +// PingPongGuideView(store: pingpongGuideStore) +// PhotoShareGuideView(store: photoShareGuideStore) + StartGuideView(store: startGuideStore) } } } diff --git a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideFeature.swift b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideFeature.swift index 33e1c63f..f7d0b31e 100644 --- a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideFeature.swift +++ b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideFeature.swift @@ -22,8 +22,17 @@ public struct MainGuideFeature { } public enum Action { + + // User Action case nextButtonDidTapped case backButtonDidTapped + + // Delegate + case delegate(Delegate) + + public enum Delegate { + case nextButtonDidTapped + } } public var body: some ReducerOf { @@ -33,12 +42,18 @@ public struct MainGuideFeature { extension MainGuideFeature { public init() { + @Dependency(\.dismiss) var dismiss let reducer = Reduce { state, action in switch action { case .nextButtonDidTapped: - return .none + return .send(.delegate(.nextButtonDidTapped)) case .backButtonDidTapped: + return .run { send in + await dismiss() + } + + default: return .none } } diff --git a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift index 854f7238..cbc450ca 100644 --- a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift @@ -28,7 +28,7 @@ public struct MainGuideView: View { Spacer() bottleArrivalImage .aspectRatio(contentMode: .fill) - .frame(width: geometry.size.width - 72) + .frame(width: geometry.size.width - 72 > 0 ? geometry.size.width - 72 : 0) .clipped() .offset(y: 48) Spacer() @@ -46,6 +46,7 @@ public struct MainGuideView: View { store.send(.backButtonDidTapped) } } + .toolbar(.visible, for: .navigationBar) } } diff --git a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideFeature.swift b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideFeature.swift index 0e66d85b..ddd277fe 100644 --- a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideFeature.swift +++ b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideFeature.swift @@ -22,8 +22,17 @@ public struct PhotoShareGuideFeature { } public enum Action { + + // User Action case nextButtonDidTapped case backButtonDidTapped + + // Delegate + case delegate(Delegate) + + public enum Delegate { + case nextButtonDidTapped + } } public var body: some ReducerOf { @@ -33,12 +42,18 @@ public struct PhotoShareGuideFeature { extension PhotoShareGuideFeature { public init() { + @Dependency(\.dismiss) var dismiss let reducer = Reduce { state, action in switch action { case .nextButtonDidTapped: - return .none + return .send(.delegate(.nextButtonDidTapped)) case .backButtonDidTapped: + return .run { send in + await dismiss() + } + + default: return .none } } diff --git a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift index 30f787d5..7a5f3056 100644 --- a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift @@ -40,7 +40,7 @@ public struct PhotoShareGuideView: View { photoShareImage .aspectRatio(contentMode: .fit) - .frame(width: geometry.size.width - 100) + .frame(width: geometry.size.width - 100 > 0 ? geometry.size.width - 100 : 0) .clipped() .offset(y: -85) } diff --git a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideFeature.swift b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideFeature.swift index c1c5733f..a790018e 100644 --- a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideFeature.swift +++ b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideFeature.swift @@ -22,8 +22,17 @@ public struct PingPongGuideFeature { } public enum Action { + + // User Action case nextButtonDidTapped case backButtonDidTapped + + // Delegate + case delegate(Delegate) + + public enum Delegate { + case nextButtonDidTapped + } } public var body: some ReducerOf { @@ -33,12 +42,18 @@ public struct PingPongGuideFeature { extension PingPongGuideFeature { public init() { + @Dependency(\.dismiss) var dismiss let reducer = Reduce { state, action in switch action { case .nextButtonDidTapped: - return .none + return .send(.delegate(.nextButtonDidTapped)) case .backButtonDidTapped: + return .run { send in + await dismiss() + } + + default: return .none } } diff --git a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift index 1eb5b6c8..7bc37982 100644 --- a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift @@ -16,6 +16,7 @@ public struct PingPongGuideView: View { public init(store: StoreOf) { self.store = store + UINavigationBar.setAnimationsEnabled(false) } public var body: some View { @@ -29,11 +30,11 @@ public struct PingPongGuideView: View { VStack(spacing: 10) { firstPingPongImage .aspectRatio(contentMode: .fit) - .frame(width: geometry.size.width - 70) + .frame(width: geometry.size.width - 70 > 0 ? geometry.size.width - 70 : 0) .clipped() secondPingPongImage .aspectRatio(contentMode: .fit) - .frame(width: geometry.size.width - 55) + .frame(width: geometry.size.width - 55 > 0 ? geometry.size.width - 55 : 0) .clipped() } Spacer() diff --git a/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideFeature.swift b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideFeature.swift index 0b4b6856..afa30e20 100644 --- a/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideFeature.swift +++ b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideFeature.swift @@ -22,8 +22,17 @@ public struct StartGuideFeature { } public enum Action { + + // User Action case doneButtonDidTapped case backButtonDidTapped + + // Delegate + case delegate(Delegate) + + public enum Delegate { + case doneButtonDidTapped + } } public var body: some ReducerOf { @@ -33,12 +42,18 @@ public struct StartGuideFeature { extension StartGuideFeature { public init() { + @Dependency(\.dismiss) var dismiss let reducer = Reduce { state, action in switch action { case .doneButtonDidTapped: - return .none + return .send(.delegate(.doneButtonDidTapped)) case .backButtonDidTapped: + return .run { send in + await dismiss() + } + + default: return .none } } diff --git a/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift index efd1ac96..493bf031 100644 --- a/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift @@ -16,6 +16,7 @@ public struct StartGuideView: View { public init(store: StoreOf) { self.store = store + UINavigationBar.setAnimationsEnabled(true) } public var body: some View { diff --git a/Projects/Feature/Guide/Sources/Source.swift b/Projects/Feature/Guide/Sources/Source.swift deleted file mode 100644 index b1853ce6..00000000 --- a/Projects/Feature/Guide/Sources/Source.swift +++ /dev/null @@ -1 +0,0 @@ -// This is for Tuist diff --git a/Projects/Feature/Guide/Sources/Sources.swift b/Projects/Feature/Guide/Sources/Sources.swift new file mode 100644 index 00000000..89c07008 --- /dev/null +++ b/Projects/Feature/Guide/Sources/Sources.swift @@ -0,0 +1,8 @@ +// +// Sources.swift +// FeatureGuide +// +// Created by 임현규 on 8/22/24. +// + +import Foundation diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift index 96e9b61e..0ff86c86 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift @@ -9,6 +9,7 @@ import Foundation import FeatureOnboardingInterface import FeatureGeneralSignUpInterface +import FeatureGuideInterface import DomainAuth import DomainAuthInterface @@ -47,7 +48,7 @@ extension LoginFeature { let userInfo = try await authClient.signInWithApple() await send(.socialLoginDidSuccess(userInfo)) // clientSceret 받아오기 - + let clientSceret = try await authClient.fetchAppleClientSecret() KeyChainTokenStore.shared.save(property: .AppleClientSecret, value: clientSceret) @@ -96,14 +97,18 @@ extension LoginFeature { if isSignUp { return .send(.goToMainTab) } else { - return goToOboarding(state: &state) + return goToGuide(state: &state) } + case .guideDidCompleted: + return goToOboarding(state: &state) + case .snsLoginButtonDidTapped: state.path.append(.appleLogin(AppleLoginFeature.State())) return .none case .path(.element(id: _, action: .onBoarding(.delegate(.createOnboardingProfileDidCompleted)))): + state.path.removeAll() return .send(.delegate(.createOnboardingProfileDidCompleted)) case let .path(.element(id: _, action: .generalLogin(.delegate(delegate)))): @@ -118,6 +123,35 @@ extension LoginFeature { return handleLoginSuccessUserInfo(state: &state, userInfo: userInfo) } + // MainGuide Delegate + case let .path(.element(id: _, action: .mainGuide(.delegate(delegate)))): + switch delegate { + case .nextButtonDidTapped: + state.path.append(.pingPongGuide(.init())) + return .none + } + + // PingPongGuide Delegate + case let .path(.element(id: _, action: .pingPongGuide(.delegate(delegate)))): + switch delegate { + case .nextButtonDidTapped: + state.path.append(.photoShareGuide(.init())) + return .none + } + // PhotoShareGuide Delegate + + case let .path(.element(id: _, action: .photoShareGuide(.delegate(delegate)))): + switch delegate { + case .nextButtonDidTapped: + state.path.append(.startGuide(.init())) + return .none + } + // StartGuide Delegate + case let .path(.element(id: _, action: .startGuide(.delegate(delegate)))): + switch delegate { + case .doneButtonDidTapped: + return goToOboarding(state: &state) + // appleLogin Delegate case let .path(.element(id: _, action: .appleLogin(.delegate(delegate)))): @@ -130,6 +164,10 @@ extension LoginFeature { } // MARK: - Inner Methods + func goToGuide(state: inout LoginFeature.State) -> Effect { + state.path.append(.mainGuide(.init())) + return .none + } func goToOboarding(state: inout LoginFeature.State) -> Effect { state.path.append(.onBoarding(.init())) @@ -167,6 +205,10 @@ extension LoginFeature { case generalLogin(GeneralLogInFeature) case generalSignUp(GeneralSignUpFeature) case onBoarding(OnboardingFeature) + case mainGuide(MainGuideFeature) + case pingPongGuide(PingPongGuideFeature) + case photoShareGuide(PhotoShareGuideFeature) + case startGuide(StartGuideFeature) case appleLogin(AppleLoginFeature) } diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift index 0b70a476..cc1b69a5 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginFeatureInterface.swift @@ -49,6 +49,7 @@ public struct LoginFeature { case personalInformationTermButtonDidTapped case utilizationTermButtonDidTapped + case guideDidCompleted case indicatorStateChanged(isLoading: Bool) case socialLoginDidSuccess(UserInfo) case signUpCheckCompleted(isSignUp: Bool) diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift index cc0100ec..612efd83 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift @@ -8,11 +8,14 @@ import SwiftUI import AuthenticationServices -import SharedDesignSystem import FeatureOnboardingInterface import FeatureGeneralSignUpInterface +import FeatureGuideInterface + import CoreLoggerInterface +import SharedDesignSystem + import ComposableArchitecture public struct LoginView: View { @@ -67,19 +70,40 @@ public struct LoginView: View { if let store = store.scope(state: \.generalLogin, action: \.generalLogin) { GeneralLogInView(store: store) } + case .onBoarding: if let store = store.scope(state: \.onBoarding, action: \.onBoarding) { OnboardingView(store: store) } + case .generalSignUp: if let store = store.scope(state: \.generalSignUp, action: \.generalSignUp) { GeneralSignUpView(store: store) } + case .mainGuide: + if let store = store.scope(state: \.mainGuide, action: \.mainGuide) { + MainGuideView(store: store) + } + + case .pingPongGuide: + if let store = store.scope(state: \.pingPongGuide, action: \.pingPongGuide) { + PingPongGuideView(store: store) + } + + case .photoShareGuide: + if let store = store.scope(state: \.photoShareGuide, action: \.photoShareGuide) { + PhotoShareGuideView(store: store) + } + + case .startGuide: + if let store = store.scope(state: \.startGuide, action: \.startGuide) { + StartGuideView(store: store) + } + case .appleLogin: if let store = store.scope(state: \.appleLogin, action: \.appleLogin) { AppleLoginView(store: store) - } } } } diff --git a/Projects/Feature/Login/Project.swift b/Projects/Feature/Login/Project.swift index 5f7d0259..8b4eae87 100644 --- a/Projects/Feature/Login/Project.swift +++ b/Projects/Feature/Login/Project.swift @@ -12,7 +12,8 @@ let project = Project.makeModule( .domain, .feature(interface: .BaseWebView), .feature(interface: .Onboarding), - .feature(interface: .GeneralSignUp) + .feature(interface: .GeneralSignUp), + .feature(interface: .Guide) ] ) ), From 0deefcbe83fda642c4c9d910bc08e5bb467599fe Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 16:38:47 +0900 Subject: [PATCH 13/22] =?UTF-8?q?feat:=20Guide=20Image=20width=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Guide/Interface/Sources/MainGuide/MainGuideView.swift | 4 +++- .../Sources/PhotoShareGuide/PhotoShareGuideView.swift | 5 +++-- .../Sources/PingPongGuide/PingPongGuideView.swift | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift index cbc450ca..680dc744 100644 --- a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift @@ -24,11 +24,13 @@ public struct MainGuideView: View { title ZStack(alignment: .bottom) { GeometryReader { geometry in + let width = geometry.size.width + let bottleArrivalImageWidth = max(width - 72, 0) HStack(spacing: 0) { Spacer() bottleArrivalImage .aspectRatio(contentMode: .fill) - .frame(width: geometry.size.width - 72 > 0 ? geometry.size.width - 72 : 0) + .frame(width: bottleArrivalImageWidth) .clipped() .offset(y: 48) Spacer() diff --git a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift index 7a5f3056..cafc8d4f 100644 --- a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift @@ -24,7 +24,8 @@ public struct PhotoShareGuideView: View { .padding(.horizontal, .md) ZStack(alignment: .bottom) { GeometryReader { geometry in - + let width = geometry.size.width + let photoShareImageWidth = max(width - 100, 0) VStack(spacing: 0) { HStack(spacing: 0) { girlImage @@ -40,7 +41,7 @@ public struct PhotoShareGuideView: View { photoShareImage .aspectRatio(contentMode: .fit) - .frame(width: geometry.size.width - 100 > 0 ? geometry.size.width - 100 : 0) + .frame(width: photoShareImageWidth) .clipped() .offset(y: -85) } diff --git a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift index 7bc37982..b21b500a 100644 --- a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift @@ -24,17 +24,19 @@ public struct PingPongGuideView: View { title ZStack(alignment: .bottom) { GeometryReader { geometry in - + let width = geometry.size.width + let firstPingPongWidth = max(width - 70, 0) + let secondPingPongWidth = max(width - 55, 0) HStack(spacing: 0) { Spacer() VStack(spacing: 10) { firstPingPongImage .aspectRatio(contentMode: .fit) - .frame(width: geometry.size.width - 70 > 0 ? geometry.size.width - 70 : 0) + .frame(width: firstPingPongWidth) .clipped() secondPingPongImage .aspectRatio(contentMode: .fit) - .frame(width: geometry.size.width - 55 > 0 ? geometry.size.width - 55 : 0) + .frame(width: secondPingPongWidth) .clipped() } Spacer() From fbbb2079cdf222d1273523d33251c57fbcaa500d Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 17:34:40 +0900 Subject: [PATCH 14/22] =?UTF-8?q?feat:=20=EC=95=A0=ED=94=8C=20=EB=A1=9C?= =?UTF-8?q?=EA=B7=B8=EC=9D=B8=20=ED=9A=8C=EC=9B=90=EA=B0=80=EC=9E=85=20?= =?UTF-8?q?=EC=8B=9C=20GuideView=20=EB=B3=B4=EC=9D=B4=EA=B2=8C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Feature/Login/Interface/Sources/Login/LoginFeature.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift index 0ff86c86..5d0b7fbe 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift @@ -87,7 +87,7 @@ extension LoginFeature { } case .userProfileFetchDiduccess: - return goToOboarding(state: &state) + return .send(.signUpCheckCompleted(isSignUp: false)) case .goToGeneralLogin: // TODO: - 일반 로그인 화면으로 이동. From 9d939acbd36193449e292aa9a1dcbb50a2516dea Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Fri, 23 Aug 2024 23:36:57 +0900 Subject: [PATCH 15/22] =?UTF-8?q?feat:=20View=20layout=20=EA=B0=92=20?= =?UTF-8?q?=EC=83=81=EC=88=98=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interface/Sources/MainGuide/MainGuideView.swift | 6 ++++-- .../Sources/PhotoShareGuide/PhotoShareGuideView.swift | 10 +++++++--- .../Sources/PingPongGuide/PingPongGuideView.swift | 10 +++++++--- .../Interface/Sources/StartGuide/StartGuideView.swift | 4 ++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift index 680dc744..83aeaf50 100644 --- a/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/MainGuide/MainGuideView.swift @@ -25,14 +25,16 @@ public struct MainGuideView: View { ZStack(alignment: .bottom) { GeometryReader { geometry in let width = geometry.size.width - let bottleArrivalImageWidth = max(width - 72, 0) + let horizontalPadding: CGFloat = 36 + let imageTopPadding: CGFloat = 48 + let bottleArrivalImageWidth = max(width - horizontalPadding * 2, 0) HStack(spacing: 0) { Spacer() bottleArrivalImage .aspectRatio(contentMode: .fill) .frame(width: bottleArrivalImageWidth) .clipped() - .offset(y: 48) + .offset(y: imageTopPadding) Spacer() } } diff --git a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift index cafc8d4f..d88f54e8 100644 --- a/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/PhotoShareGuide/PhotoShareGuideView.swift @@ -25,7 +25,11 @@ public struct PhotoShareGuideView: View { ZStack(alignment: .bottom) { GeometryReader { geometry in let width = geometry.size.width - let photoShareImageWidth = max(width - 100, 0) + let horizontalPadding: CGFloat = 50 + let imageSetTopPadding: CGFloat = 48 + let photoShareTopPadding: CGFloat = -85 + let photoShareImageWidth = max(width - horizontalPadding * 2, 0) + VStack(spacing: 0) { HStack(spacing: 0) { girlImage @@ -43,9 +47,9 @@ public struct PhotoShareGuideView: View { .aspectRatio(contentMode: .fit) .frame(width: photoShareImageWidth) .clipped() - .offset(y: -85) + .offset(y: photoShareTopPadding) } - .offset(y: 48) + .offset(y: imageSetTopPadding) } nextButton .padding(.bottom, .lg) diff --git a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift index b21b500a..2a7ff7bd 100644 --- a/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/PingPongGuide/PingPongGuideView.swift @@ -25,8 +25,12 @@ public struct PingPongGuideView: View { ZStack(alignment: .bottom) { GeometryReader { geometry in let width = geometry.size.width - let firstPingPongWidth = max(width - 70, 0) - let secondPingPongWidth = max(width - 55, 0) + let firstHorizontalPadding: CGFloat = 35 + let firstPingPongWidth = max(width - firstHorizontalPadding * 2, 0) + let secondHorizontalPadding: CGFloat = 27.5 + let secondPingPongWidth = max(width - secondHorizontalPadding * 2, 0) + let imageSetTopPadding: CGFloat = 48 + HStack(spacing: 0) { Spacer() VStack(spacing: 10) { @@ -41,7 +45,7 @@ public struct PingPongGuideView: View { } Spacer() } - .offset(y: 48) + .offset(y: imageSetTopPadding) } nextButton .padding(.bottom, .lg) diff --git a/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift index 493bf031..5204bc1a 100644 --- a/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift +++ b/Projects/Feature/Guide/Interface/Sources/StartGuide/StartGuideView.swift @@ -24,14 +24,14 @@ public struct StartGuideView: View { title ZStack(alignment: .bottom) { GeometryReader { geometry in - + let bottleImageTopPadding: CGFloat = 48 HStack(spacing: 0) { Spacer() bottleImage .scaledToFit() Spacer() } - .offset(y: 48) + .offset(y: bottleImageTopPadding) } doneButton .padding(.bottom, .lg) From 6068bb752faf004f699a5ceaede1d16bcaac8b20 Mon Sep 17 00:00:00 2001 From: JongHoon Date: Fri, 23 Aug 2024 20:41:47 +0900 Subject: [PATCH 16/22] =?UTF-8?q?chore:=20stopTalkButtonTapped=20->=20stop?= =?UTF-8?q?TalkButtonDidTapped=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QuestionAndAnswer/QuestionAndAnswerFeature.swift | 2 +- .../QuestionAndAnswerFeatureInterface.swift | 2 +- .../SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift index a2aa05db..6bf1ad2f 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift @@ -82,7 +82,7 @@ extension QuestionAndAnswerFeature { } } - case .stopTalkButtonTapped: + case .stopTalkButtonDidTapped: state.destination = .alert(.init( title: { TextState("중단하기") }, actions: { diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift index 325aa352..ba8c43aa 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift @@ -204,7 +204,7 @@ public struct QuestionAndAnswerFeature { case finalSelectButtonDidTapped(willMatch: Bool) case refreshPingPongDidRequired case configureShowLoadingIndicatorRequired(isShow: Bool) - case stopTalkButtonTapped + case stopTalkButtonDidTapped // ETC. case binding(BindingAction) diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift index 8123ba2f..ff314190 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift @@ -103,7 +103,7 @@ public struct QuestionAndAnswerView: View { color: .enableSecondary ) .asThrottleButton { - store.send(.stopTalkButtonTapped) + store.send(.stopTalkButtonDidTapped) } .padding(.top, 12.0) .disabled(store.isStopped == true) @@ -121,6 +121,9 @@ public struct QuestionAndAnswerView: View { .onChange(of: store.textFieldState) { textFieldState in isTextFieldFocused = textFieldState == .active || textFieldState == .enabled ? false : true } + } + .refreshable { + } .scrollIndicators(.hidden) .overlay { From 1fcdafc1da69fcf4a0e47935d5ec405b4c239f52 Mon Sep 17 00:00:00 2001 From: JongHoon Date: Fri, 23 Aug 2024 22:46:13 +0900 Subject: [PATCH 17/22] =?UTF-8?q?feat:=20=ED=95=91=ED=90=81=20=EB=AC=B8?= =?UTF-8?q?=EB=8B=B5=20pull=20to=20refresh=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Feature/BottleStorage/Example/Sources/AppView.swift | 6 ------ .../View/PingPongDetail/PingPongDetailFeature.swift | 2 ++ .../QuestionAndAnswer/QuestionAndAnswerFeature.swift | 3 +++ .../QuestionAndAnswerFeatureInterface.swift | 2 ++ .../SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Projects/Feature/BottleStorage/Example/Sources/AppView.swift b/Projects/Feature/BottleStorage/Example/Sources/AppView.swift index ef784883..e05e0e8c 100644 --- a/Projects/Feature/BottleStorage/Example/Sources/AppView.swift +++ b/Projects/Feature/BottleStorage/Example/Sources/AppView.swift @@ -21,12 +21,6 @@ struct AppView: App { initialState: BottleStorageFeature.State(), reducer: { BottleStorageFeature() } )) - .onAppear { - AuthClient.liveValue.saveToken(token: .init( - accessToken: "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNzIzMTE3ODk1LCJleHAiOjE3MjMxNTM4OTV9.HjjnS1onaAUA6nJGOV-f6FE55eAihUGTFNYGmmyETQc", - refershToken: "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNzIzMTE3ODk1LCJleHAiOjE3Mzc2MzMwOTV9.Af-L2h_5pBQWrZCc1OQI3tm1DGwowqCAId-rK5vAPaQ" - )) - } } } } diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/PingPongDetail/PingPongDetailFeature.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/PingPongDetail/PingPongDetailFeature.swift index cc01fbd4..d1ee40f0 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/PingPongDetail/PingPongDetailFeature.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/PingPongDetail/PingPongDetailFeature.swift @@ -54,6 +54,8 @@ extension PingPongDetailFeature { return fetchPingPong(state: &state) case .popToRootDidRequired: return .send(.delegate(.popToRootDidRequired)) + case .refreshPingPong: + return fetchPingPong(state: &state) } case let .matching(.delegate(delegate)): diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift index 6bf1ad2f..5a4dc213 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeature.swift @@ -94,6 +94,9 @@ extension QuestionAndAnswerFeature { message: { TextState("중단 시 모든 핑퐁 내용이 사라져요. 정말 중단하시겠어요?") } )) return .none + + case .refreshDidPulled: + return .send(.delegate(.refreshPingPong)) case let .destination(.presented(.alert(alert))): switch alert { diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift index ba8c43aa..4353b898 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerFeatureInterface.swift @@ -205,6 +205,7 @@ public struct QuestionAndAnswerFeature { case refreshPingPongDidRequired case configureShowLoadingIndicatorRequired(isShow: Bool) case stopTalkButtonDidTapped + case refreshDidPulled // ETC. case binding(BindingAction) @@ -220,6 +221,7 @@ public struct QuestionAndAnswerFeature { public enum Delegate { case reloadPingPongRequired case popToRootDidRequired + case refreshPingPong } } diff --git a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift index ff314190..b8208f68 100644 --- a/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift +++ b/Projects/Feature/BottleStorage/Interface/Sources/PingPongDetail/View/SubViews/QuestionAndAnswer/QuestionAndAnswerView.swift @@ -123,7 +123,8 @@ public struct QuestionAndAnswerView: View { } } .refreshable { - + try? await Task.sleep(nanoseconds: 300_000_000) + await store.send(.refreshDidPulled).finish() } .scrollIndicators(.hidden) .overlay { From cc1d6942a2de8b9e079ef5c4cbd5e4b831490d8c Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Sat, 24 Aug 2024 00:04:09 +0900 Subject: [PATCH 18/22] =?UTF-8?q?refactor:=20reslove=EC=8B=9C=20=EB=B0=9C?= =?UTF-8?q?=EC=83=9D=ED=95=9C=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Login/LoginFeature.swift | 4 +- .../Interface/Sources/Login/LoginView.swift | 72 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift index 5d0b7fbe..2bd4b617 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginFeature.swift @@ -150,8 +150,8 @@ extension LoginFeature { case let .path(.element(id: _, action: .startGuide(.delegate(delegate)))): switch delegate { case .doneButtonDidTapped: - return goToOboarding(state: &state) - + return goToOboarding(state: &state) + } // appleLogin Delegate case let .path(.element(id: _, action: .appleLogin(.delegate(delegate)))): diff --git a/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift b/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift index 612efd83..3b585f70 100644 --- a/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift +++ b/Projects/Feature/Login/Interface/Sources/Login/LoginView.swift @@ -28,41 +28,40 @@ public struct LoginView: View { public var body: some View { WithPerceptionTracking { NavigationStack(path: $store.scope(state: \.path, action: \.path)) { - VStack(spacing: 0) { - Spacer() - .frame(height: 52) - whiteLogo - .padding(.top, 52) - .padding(.bottom, .xl) - - mainText - - Spacer() - - VStack(spacing: 30.0) { - signInWithKakaoButton - snsLoginButton - } - .padding(.bottom, 30.0) + VStack(spacing: 0) { + Spacer() + .frame(height: 52) + whiteLogo + .padding(.top, 52) + .padding(.bottom, .xl) + + mainText + + Spacer() + + VStack(spacing: 30.0) { + signInWithKakaoButton + snsLoginButton } - .background { - BottleImageView( - type: .local(bottleImageSystem: .illustraition(.loginBackground)) - ) - } - .edgesIgnoringSafeArea([.top, .bottom]) - .sheet( - isPresented: $store.isPresentTermView, - content: { - TermsWebView(url: store.termURL) - } + .padding(.bottom, 30.0) + } + .background { + BottleImageView( + type: .local(bottleImageSystem: .illustraition(.loginBackground)) ) - .overlay { - if store.isLoading { - LoadingIndicator() - } + } + .edgesIgnoringSafeArea([.top, .bottom]) + .sheet( + isPresented: $store.isPresentTermView, + content: { + TermsWebView(url: store.termURL) } - + ) + .overlay { + if store.isLoading { + LoadingIndicator() + } + } } destination: { store in WithPerceptionTracking { switch store.state { @@ -70,12 +69,12 @@ public struct LoginView: View { if let store = store.scope(state: \.generalLogin, action: \.generalLogin) { GeneralLogInView(store: store) } - + case .onBoarding: if let store = store.scope(state: \.onBoarding, action: \.onBoarding) { OnboardingView(store: store) } - + case .generalSignUp: if let store = store.scope(state: \.generalSignUp, action: \.generalSignUp) { GeneralSignUpView(store: store) @@ -99,11 +98,12 @@ public struct LoginView: View { case .startGuide: if let store = store.scope(state: \.startGuide, action: \.startGuide) { StartGuideView(store: store) - } - + } + case .appleLogin: if let store = store.scope(state: \.appleLogin, action: \.appleLogin) { AppleLoginView(store: store) + } } } } From 12f62244fc2c44be758e78693767a43dc0d81c7c Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Sat, 24 Aug 2024 00:28:43 +0900 Subject: [PATCH 19/22] =?UTF-8?q?chore:=20=EB=B9=8C=EB=93=9C=20=EB=84=98?= =?UTF-8?q?=EB=B2=84=201.0.3=20(22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift b/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift index 0efc57b9..54413f3e 100644 --- a/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift +++ b/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift @@ -10,8 +10,8 @@ import ProjectDescription public extension InfoPlist { static var app: InfoPlist { return .extendingDefault(with: [ - "CFBundleShortVersionString": "1.0.2", - "CFBundleVersion": "21", + "CFBundleShortVersionString": "1.0.3", + "CFBundleVersion": "22", "UIUserInterfaceStyle": "Light", "CFBundleName": "보틀", "UILaunchScreen": [ @@ -39,8 +39,8 @@ public extension InfoPlist { static var example: InfoPlist { return .extendingDefault(with: [ - "CFBundleShortVersionString": "1.0.2", - "CFBundleVersion": "21", + "CFBundleShortVersionString": "1.0.3", + "CFBundleVersion": "22", "UIUserInterfaceStyle": "Light", "UILaunchScreen": [:], "UISupportedInterfaceOrientations": [ From 343c957ba6d406f56534ad5c44b454c7f96f5925 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Sat, 24 Aug 2024 02:32:16 +0900 Subject: [PATCH 20/22] =?UTF-8?q?feat:=20FCM=20Token=20UserClient=EB=A1=9C?= =?UTF-8?q?=20=EA=B4=80=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../User/Interface/Sources/UserClient.swift | 16 +++++++++++++++- Projects/Domain/User/Sources/UserClient.swift | 8 ++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Projects/Domain/User/Interface/Sources/UserClient.swift b/Projects/Domain/User/Interface/Sources/UserClient.swift index c140a255..dadc0abd 100644 --- a/Projects/Domain/User/Interface/Sources/UserClient.swift +++ b/Projects/Domain/User/Interface/Sources/UserClient.swift @@ -10,19 +10,25 @@ import Foundation public struct UserClient { private let _isLoggedIn: () -> Bool private let _isAppDeleted: () -> Bool + private let _fetchFcmToken: () -> String? private let updateLoginState: (Bool) -> Void private let updateDeleteState: (Bool) -> Void + private let updateFcmToken: (String) -> Void public init( isLoggedIn: @escaping () -> Bool, isAppDeleted: @escaping () -> Bool, + fetchFcmToken: @escaping () -> String?, updateLoginState: @escaping (Bool) -> Void, - updateDeleteState: @escaping (Bool) -> Void + updateDeleteState: @escaping (Bool) -> Void, + updateFcmToken: @escaping (String) -> Void ) { self._isLoggedIn = isLoggedIn self._isAppDeleted = isAppDeleted + self._fetchFcmToken = fetchFcmToken self.updateLoginState = updateLoginState self.updateDeleteState = updateDeleteState + self.updateFcmToken = updateFcmToken } public func isLoggedIn() -> Bool { @@ -33,6 +39,10 @@ public struct UserClient { _isAppDeleted() } + public func fetchFcmToken() -> String? { + _fetchFcmToken() + } + public func updateLoginState(isLoggedIn: Bool) { updateLoginState(isLoggedIn) } @@ -40,4 +50,8 @@ public struct UserClient { public func updateDeleteState(isDelete: Bool) { updateDeleteState(isDelete) } + + public func updateFcmToken(fcmToken: String) { + updateFcmToken(fcmToken) + } } diff --git a/Projects/Domain/User/Sources/UserClient.swift b/Projects/Domain/User/Sources/UserClient.swift index 96f0107f..6df5fad8 100644 --- a/Projects/Domain/User/Sources/UserClient.swift +++ b/Projects/Domain/User/Sources/UserClient.swift @@ -26,12 +26,20 @@ extension UserClient: DependencyKey { return !UserDefaults.standard.bool(forKey: "deleteState") }, + fetchFcmToken: { + return UserDefaults.standard.string(forKey: "fcmToken") + }, + updateLoginState: { isLoggedIn in UserDefaults.standard.set(isLoggedIn, forKey: "loginState") }, updateDeleteState: { isDelete in UserDefaults.standard.set(!isDelete, forKey: "deleteState") + }, + + updateFcmToken: { fcmToken in + UserDefaults.standard.set(fcmToken, forKey: "fcmToken") } ) } From 3a7c842290f23f24a29b89cf3ef919c136ea12a9 Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Sat, 24 Aug 2024 02:32:59 +0900 Subject: [PATCH 21/22] =?UTF-8?q?feat:=20Fcm=20Token=20recevied=EB=90=9C?= =?UTF-8?q?=20=ED=9B=84=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=20=EB=B3=B4=EC=9D=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Projects/App/Sources/AppDelegate.swift | 2 +- Projects/Domain/Auth/Sources/AuthClient.swift | 14 +++++++++----- .../Feature/Sources/App/AppDelegateFeature.swift | 16 ++++++++++++++++ Projects/Feature/Sources/App/AppFeature.swift | 11 ++++++++++- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/Projects/App/Sources/AppDelegate.swift b/Projects/App/Sources/AppDelegate.swift index 1a599a09..1b193461 100644 --- a/Projects/App/Sources/AppDelegate.swift +++ b/Projects/App/Sources/AppDelegate.swift @@ -44,7 +44,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate { Log.debug("fcm token: \(fcmToken ?? "NO TOKEN")") if let fcmToken { // TODO: user defaults 설정 방법 변경 - UserDefaults.standard.set(fcmToken, forKey: "fcmToken") + store.send(.appDelegate(.didReceivedFcmToken(fcmToken: fcmToken))) } } diff --git a/Projects/Domain/Auth/Sources/AuthClient.swift b/Projects/Domain/Auth/Sources/AuthClient.swift index 581a331e..d0c0b081 100644 --- a/Projects/Domain/Auth/Sources/AuthClient.swift +++ b/Projects/Domain/Auth/Sources/AuthClient.swift @@ -8,6 +8,8 @@ import Foundation import DomainAuthInterface +import DomainUser + import CoreNetwork import CoreLoggerInterface @@ -19,12 +21,13 @@ extension AuthClient: DependencyKey { private static func live() -> AuthClient { @Dependency(\.network) var networkManager @Dependency(\.loginManager) var loginManager - + @Dependency(\.userClient) var userClient return .init( signInWithKakao: { let signInResult = try await loginManager.signIn(loginType: .kakao) let accessToken = signInResult.accessToken - guard let fcmToken = UserDefaults.standard.string(forKey: "fcmToken") + let fcmToken = userClient.fetchFcmToken() + guard let fcmToken = fcmToken else { Log.fault("no fcm token") fatalError() @@ -40,8 +43,8 @@ extension AuthClient: DependencyKey { let signInResult = try await loginManager.signIn(loginType: .apple) let accessToken = signInResult.accessToken let userName = signInResult.userName - - guard let fcmToken = UserDefaults.standard.string(forKey: "fcmToken") + let fcmToken = userClient.fetchFcmToken() + guard let fcmToken = fcmToken else { Log.fault("no fcm token") fatalError() @@ -62,7 +65,8 @@ extension AuthClient: DependencyKey { try await networkManager.reqeust(api: .apiType(AuthAPI.withdraw)) }, logout: { - guard let fcmToken = UserDefaults.standard.string(forKey: "fcmToken") + let fcmToken = userClient.fetchFcmToken() + guard let fcmToken = fcmToken else { Log.fault("no fcm token") return diff --git a/Projects/Feature/Sources/App/AppDelegateFeature.swift b/Projects/Feature/Sources/App/AppDelegateFeature.swift index d2ec159c..4233bede 100644 --- a/Projects/Feature/Sources/App/AppDelegateFeature.swift +++ b/Projects/Feature/Sources/App/AppDelegateFeature.swift @@ -19,6 +19,14 @@ public struct AppDelegateFeature { public enum Action { case didFinishLunching + case didReceivedFcmToken(fcmToken: String) + + // Delegate + case delegate(Delegate) + + public enum Delegate { + case fcmTokenDidRecevied(fcmToken: String) + } } public var body: some ReducerOf { @@ -37,6 +45,14 @@ public struct AppDelegateFeature { KakaoSDK.initSDK(appKey: kakaoAppKey) return .none + + case let .didReceivedFcmToken(fcmToken): + return .run { send in + await send(.delegate(.fcmTokenDidRecevied(fcmToken: fcmToken))) + } + + default: + return .none } } } diff --git a/Projects/Feature/Sources/App/AppFeature.swift b/Projects/Feature/Sources/App/AppFeature.swift index a20dcc19..a5454124 100644 --- a/Projects/Feature/Sources/App/AppFeature.swift +++ b/Projects/Feature/Sources/App/AppFeature.swift @@ -52,6 +52,7 @@ public struct AppFeature { case login(LoginFeature.Action) case onboarding(OnboardingFeature.Action) + case checkUserLoginState case sceneDidActive case appleUserIdDidRevoked case loginCheckCompleted(isLoggedIn: Bool) @@ -85,7 +86,7 @@ public struct AppFeature { action: Action ) -> EffectOf { switch action { - case .onAppear: + case .checkUserLoginState: let isAppDeleted = userClient.isAppDeleted() let isLoggedIn = authClient.checkTokenIsExist() @@ -120,6 +121,14 @@ public struct AppFeature { return changeRoot(.Onboarding, state: &state) } + // AppDelegate Delegate + case let .appDelegate(.delegate(delegate)): + switch delegate { + case let .fcmTokenDidRecevied(fcmToken): + userClient.updateFcmToken(fcmToken: fcmToken) + return .send(.checkUserLoginState) + } + // Login Delegate case let .login(.delegate(delegate)): switch delegate { From 77211d37724cf71925e468f8ade85efff6050e4e Mon Sep 17 00:00:00 2001 From: leemhyungyu Date: Sat, 24 Aug 2024 02:50:34 +0900 Subject: [PATCH 22/22] =?UTF-8?q?chore:=20=EB=B9=8C=EB=93=9C=20=EB=84=98?= =?UTF-8?q?=EB=B2=84=201.0.3=20(23)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift b/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift index 54413f3e..91930e50 100644 --- a/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift +++ b/Tuist/ProjectDescriptionHelpers/InfoPlist+Templates.swift @@ -11,7 +11,7 @@ public extension InfoPlist { static var app: InfoPlist { return .extendingDefault(with: [ "CFBundleShortVersionString": "1.0.3", - "CFBundleVersion": "22", + "CFBundleVersion": "23", "UIUserInterfaceStyle": "Light", "CFBundleName": "보틀", "UILaunchScreen": [ @@ -40,7 +40,7 @@ public extension InfoPlist { static var example: InfoPlist { return .extendingDefault(with: [ "CFBundleShortVersionString": "1.0.3", - "CFBundleVersion": "22", + "CFBundleVersion": "23", "UIUserInterfaceStyle": "Light", "UILaunchScreen": [:], "UISupportedInterfaceOrientations": [