From 6f48b4efc704b1d10093bed68ed8f07b5637538e Mon Sep 17 00:00:00 2001 From: cchanmi <113524@naver.com> Date: Wed, 11 Dec 2024 00:05:43 +0900 Subject: [PATCH 01/10] [FEAT] #239 - diary detail amplitude --- .../Global/Constants/AmplitudeConstant.swift | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift b/Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift index 2ba50fb8..e7fb3f56 100644 --- a/Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift +++ b/Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift @@ -131,15 +131,24 @@ enum AmplitudeConstant { } enum diaryDetail { + case toggle_click(String) case mydiary_click - case mydiary_edit + case mydiary_view(Bool) + case mydiary_edit(Bool) + case mydiary_edit_complete_click(Bool) var event: BaseEvent { switch self { + case .toggle_click(let toggle): + return BaseEvent(eventType: "toggle_click", eventProperties: ["toggle": toggle]) case .mydiary_click: return BaseEvent(eventType: "mydiary_click", eventProperties: nil) - case .mydiary_edit: - return BaseEvent(eventType: "mydiary_edit", eventProperties: nil) + case .mydiary_view(let hasCoaching): + return BaseEvent(eventType: "mydiary_view", eventProperties: ["has_coaching": hasCoaching]) + case .mydiary_edit(let hasCoaching): + return BaseEvent(eventType: "mydiary_edit", eventProperties: ["has_coaching": hasCoaching]) + case .mydiary_edit_complete_click(let hasCoaching): + return BaseEvent(eventType: "mydiary_edit_complete_click", eventProperties: ["has_coaching": hasCoaching]) } } } @@ -175,4 +184,22 @@ enum AmplitudeConstant { } } } + + enum coaching { + case coaching_try_click + case coaching_exit_click + case coaching_load_view + case coaching_result_view + case coaching_feedback_view + + var event: BaseEvent { + switch self { + case .achievement_view: + return BaseEvent(eventType: "achievement_view", eventProperties: nil) + case .badge_bottom_sheet_view(let type, let hasBadge): + return BaseEvent(eventType: "badge_bottom_sheet_view", eventProperties: ["BadgeType":type, + "hasBadge":hasBadge]) + } + } + } } From 73cc9338cbd361b6139c440b2823022a54d33a23 Mon Sep 17 00:00:00 2001 From: Joon Baek Date: Wed, 11 Dec 2024 00:25:16 +0900 Subject: [PATCH 02/10] =?UTF-8?q?[Add]=20#239=20-=20Double+=20=EB=88=84?= =?UTF-8?q?=EB=9D=BD=20=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj | 64 ++++++------------- 1 file changed, 19 insertions(+), 45 deletions(-) diff --git a/Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj b/Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj index 0c7a2012..4c28789a 100644 --- a/Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj +++ b/Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj @@ -17,7 +17,6 @@ 370BD0B32CFB65BE009560DB /* RandomTopicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370BD0AA2CFB65BE009560DB /* RandomTopicView.swift */; }; 370BD0B42CFB65BE009560DB /* AlarmCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370BD0A32CFB65BE009560DB /* AlarmCollectionViewCell.swift */; }; 370BD0B52CFB65BE009560DB /* AlarmDefaultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370BD0A42CFB65BE009560DB /* AlarmDefaultModel.swift */; }; - 370BD0B82CFBF50C009560DB /* Double+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370BD0B72CFBF50C009560DB /* Double+.swift */; }; 371107DA2AC99099007A4AC2 /* KeyboardFollowingLayoutHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 371107D92AC99099007A4AC2 /* KeyboardFollowingLayoutHandler.swift */; }; 371107DD2ACAB571007A4AC2 /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 371107DC2ACAB571007A4AC2 /* BaseView.swift */; }; 371107DF2ACAB709007A4AC2 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 371107DE2ACAB709007A4AC2 /* BaseViewController.swift */; }; @@ -40,6 +39,8 @@ 375B628B2C590D0D00DA8E30 /* FirebaseMessaging in Frameworks */ = {isa = PBXBuildFile; productRef = 375B628A2C590D0D00DA8E30 /* FirebaseMessaging */; }; 375B628D2C590D0D00DA8E30 /* FirebaseRemoteConfig in Frameworks */ = {isa = PBXBuildFile; productRef = 375B628C2C590D0D00DA8E30 /* FirebaseRemoteConfig */; }; 3761116C2A278D0E0095EC5A /* String+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3761116B2A278D0E0095EC5A /* String+.swift */; }; + 376947892D0894A2006A46B1 /* Double+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376947882D0894A2006A46B1 /* Double+.swift */; }; + 377B3BF02CF613710086E0BC /* HighlightModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 377B3BEF2CF613710086E0BC /* HighlightModifier.swift */; }; 3785072F2BD1480C004CC922 /* SharedDiaryDataService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37499E3C2BD0C3A100BA6FAF /* SharedDiaryDataService.swift */; }; 378B20EE2BA0A01600604935 /* ForeignDiaryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 378B20ED2BA0A01600604935 /* ForeignDiaryViewModel.swift */; }; 378B20F02BA0A02400604935 /* StepOneKoreanDiaryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 378B20EF2BA0A02400604935 /* StepOneKoreanDiaryViewModel.swift */; }; @@ -67,10 +68,6 @@ 37B123B62CEEE58E00ED973A /* DetailDiaryCoachedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37B123B52CEEE58E00ED973A /* DetailDiaryCoachedView.swift */; }; 37BCADF22BC3FFBF006EF960 /* DetailDiaryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BCADF12BC3FFBF006EF960 /* DetailDiaryViewModel.swift */; }; 37BDC9872C4FEA940075F68A /* SendFeedbackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BDC9862C4FEA940075F68A /* SendFeedbackView.swift */; }; - 37BF485B2D08676A0013669A /* HighlightModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BF485A2D08676A0013669A /* HighlightModifier.swift */; }; - 37BF485E2D0867DC0013669A /* CoachingResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BF485C2D0867DC0013669A /* CoachingResponse.swift */; }; - 37BF48742D086A6C0013669A /* SmemeLoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BF48722D086A6C0013669A /* SmemeLoadingView.swift */; }; - 37BF48772D086A8B0013669A /* SmemeToastView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BF48752D086A8B0013669A /* SmemeToastView.swift */; }; 37DCA6572A47574300FF8F90 /* RandomTopicAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DCA6562A47574300FF8F90 /* RandomTopicAPI.swift */; }; 37DCA65A2A47598700FF8F90 /* RandomTopicService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DCA6592A47598700FF8F90 /* RandomTopicService.swift */; }; 37DCA65D2A475B5100FF8F90 /* RandomTopicResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DCA65C2A475B5100FF8F90 /* RandomTopicResponse.swift */; }; @@ -248,7 +245,6 @@ 370BD0A92CFB65BE009560DB /* DiaryScrollerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryScrollerView.swift; sourceTree = ""; }; 370BD0AA2CFB65BE009560DB /* RandomTopicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RandomTopicView.swift; sourceTree = ""; }; 370BD0AB2CFB65BE009560DB /* SeparationLine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeparationLine.swift; sourceTree = ""; }; - 370BD0B72CFBF50C009560DB /* Double+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Double+.swift"; sourceTree = ""; }; 371107D92AC99099007A4AC2 /* KeyboardFollowingLayoutHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardFollowingLayoutHandler.swift; sourceTree = ""; }; 371107DC2ACAB571007A4AC2 /* BaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseView.swift; sourceTree = ""; }; 371107DE2ACAB709007A4AC2 /* BaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = ""; }; @@ -268,6 +264,8 @@ 374F828B2AC327A200C128B9 /* SmeemTextViewHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmeemTextViewHandler.swift; sourceTree = ""; }; 374FAF802A2CACCF00237A1A /* DiaryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryViewController.swift; sourceTree = ""; }; 3761116B2A278D0E0095EC5A /* String+.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+.swift"; sourceTree = ""; }; + 376947882D0894A2006A46B1 /* Double+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Double+.swift"; sourceTree = ""; }; + 377B3BEF2CF613710086E0BC /* HighlightModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightModifier.swift; sourceTree = ""; }; 378B20ED2BA0A01600604935 /* ForeignDiaryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForeignDiaryViewModel.swift; sourceTree = ""; }; 378B20EF2BA0A02400604935 /* StepOneKoreanDiaryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepOneKoreanDiaryViewModel.swift; sourceTree = ""; }; 378B20F12BA0A03000604935 /* StepTwoKoreanDiaryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepTwoKoreanDiaryViewModel.swift; sourceTree = ""; }; @@ -294,10 +292,6 @@ 37B123B52CEEE58E00ED973A /* DetailDiaryCoachedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailDiaryCoachedView.swift; sourceTree = ""; }; 37BCADF12BC3FFBF006EF960 /* DetailDiaryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailDiaryViewModel.swift; sourceTree = ""; }; 37BDC9862C4FEA940075F68A /* SendFeedbackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendFeedbackView.swift; sourceTree = ""; }; - 37BF485A2D08676A0013669A /* HighlightModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightModifier.swift; sourceTree = ""; }; - 37BF485C2D0867DC0013669A /* CoachingResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoachingResponse.swift; sourceTree = ""; }; - 37BF48722D086A6C0013669A /* SmemeLoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmemeLoadingView.swift; sourceTree = ""; }; - 37BF48752D086A8B0013669A /* SmemeToastView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmemeToastView.swift; sourceTree = ""; }; 37DCA6562A47574300FF8F90 /* RandomTopicAPI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomTopicAPI.swift; sourceTree = ""; }; 37DCA6592A47598700FF8F90 /* RandomTopicService.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomTopicService.swift; sourceTree = ""; }; 37DCA65C2A475B5100FF8F90 /* RandomTopicResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RandomTopicResponse.swift; sourceTree = ""; }; @@ -465,6 +459,8 @@ 4AB349522CF22AD30047C484 /* Auth */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Auth; sourceTree = ""; }; 4AB349532CF22AD90047C484 /* Badge */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Badge; sourceTree = ""; }; 4AB349562CF22BFF0047C484 /* EditUser */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = EditUser; sourceTree = ""; }; + 4AB349BA2CF23B770047C484 /* Coaching */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Coaching; sourceTree = ""; }; + 4AB349BC2CF23D210047C484 /* Coaching */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Coaching; sourceTree = ""; }; 4AF050CE2CE9DE010055BC3F /* Coaching */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Coaching; sourceTree = ""; }; 4AF050D82CEA01EA0055BC3F /* Coaching */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Coaching; sourceTree = ""; }; /* End PBXFileSystemSynchronizedRootGroup section */ @@ -566,8 +562,8 @@ 373D29912CBFE16B00A559A3 /* SwiftUI */ = { isa = PBXGroup; children = ( + 377B3BEF2CF613710086E0BC /* HighlightModifier.swift */, 373D29922CBFE17B00A559A3 /* View+.swift */, - 37BF485A2D08676A0013669A /* HighlightModifier.swift */, ); path = SwiftUI; sourceTree = ""; @@ -657,7 +653,7 @@ 4A4FEB002B721956001BBDF3 /* Combine+.swift */, 4AB7C9182B75F9B500845733 /* GesturePublisher+.swift */, 4AF050EA2CEA300F0055BC3F /* MoyaProvier+.swift */, - 370BD0B72CFBF50C009560DB /* Double+.swift */, + 376947882D0894A2006A46B1 /* Double+.swift */, ); path = Extensions; sourceTree = ""; @@ -747,30 +743,6 @@ path = Controllers; sourceTree = ""; }; - 37BF485D2D0867DC0013669A /* Coaching */ = { - isa = PBXGroup; - children = ( - 37BF485C2D0867DC0013669A /* CoachingResponse.swift */, - ); - path = Coaching; - sourceTree = ""; - }; - 37BF48732D086A6C0013669A /* LoadingView */ = { - isa = PBXGroup; - children = ( - 37BF48722D086A6C0013669A /* SmemeLoadingView.swift */, - ); - path = LoadingView; - sourceTree = ""; - }; - 37BF48762D086A8B0013669A /* Toast */ = { - isa = PBXGroup; - children = ( - 37BF48752D086A8B0013669A /* SmemeToastView.swift */, - ); - path = Toast; - sourceTree = ""; - }; 37CD0DB32A1DEE64001F03E7 /* Diaries */ = { isa = PBXGroup; children = ( @@ -926,6 +898,7 @@ 4A07F8D92B821523004185F2 /* Smeem-iOSTests */ = { isa = PBXGroup; children = ( + 4AB349BC2CF23D210047C484 /* Coaching */, 4AF78D9C2B84AB5D0098E1FA /* Base */, 4A07F8E12B821529004185F2 /* Onboarding */, ); @@ -978,7 +951,7 @@ 4A0EA45C2A014126006CCE52 /* NetworkDataModel */ = { isa = PBXGroup; children = ( - 37BF485D2D0867DC0013669A /* Coaching */, + 4AB349BA2CF23B770047C484 /* Coaching */, 4AB349562CF22BFF0047C484 /* EditUser */, 4AB349532CF22AD90047C484 /* Badge */, 4AB349522CF22AD30047C484 /* Auth */, @@ -1032,9 +1005,9 @@ 4A1EE9552A4DFB86007BFEF3 /* SmeemComponent */ = { isa = PBXGroup; children = ( - 37BF48732D086A6C0013669A /* LoadingView */, + 4A17370F2D05C03600B772C3 /* LoadingView */, + 4A17370E2D05C02E00B772C3 /* Toast */, 4AB349502CF22A2E0047C484 /* TextView */, - 37BF48762D086A8B0013669A /* Toast */, 4AB3494F2CF22A250047C484 /* Button */, 4AB3494E2CF22A070047C484 /* Global */, 379789012AAB9B1900C61EF4 /* NavigationBar */, @@ -1746,6 +1719,9 @@ dependencies = ( 4A07F8DD2B821523004185F2 /* PBXTargetDependency */, ); + fileSystemSynchronizedGroups = ( + 4AB349BC2CF23D210047C484 /* Coaching */, + ); name = "Smeem-iOSTests"; productName = "Smeem-iOSTests"; productReference = 4A07F8D82B821523004185F2 /* Smeem-iOSTests.xctest */; @@ -1774,6 +1750,7 @@ 4AB349522CF22AD30047C484 /* Auth */, 4AB349532CF22AD90047C484 /* Badge */, 4AB349562CF22BFF0047C484 /* EditUser */, + 4AB349BA2CF23B770047C484 /* Coaching */, 4AF050CE2CE9DE010055BC3F /* Coaching */, 4AF050D82CEA01EA0055BC3F /* Coaching */, ); @@ -1907,6 +1884,7 @@ 4AC705AE2BECF0D4003C5310 /* EditPlanViewModel.swift in Sources */, 4AF7C22F2BFB797600E8C6CD /* LockBadgeCollectionViewCell.swift in Sources */, 6F294A3E2A26177B00856CC8 /* TrainingGoalViewController.swift in Sources */, + 376947892D0894A2006A46B1 /* Double+.swift in Sources */, 4ABCBCCE2BDE95D0003138A8 /* MyPlanResponse.swift in Sources */, 4A9731D92BAAB70500DEC0C8 /* UpdateResponse.swift in Sources */, 4ABCBCEC2BE261B0003138A8 /* TrainingCollectionViewDatasource.swift in Sources */, @@ -1930,7 +1908,6 @@ 370BD0B32CFB65BE009560DB /* RandomTopicView.swift in Sources */, 370BD0B42CFB65BE009560DB /* AlarmCollectionViewCell.swift in Sources */, 370BD0B52CFB65BE009560DB /* AlarmDefaultModel.swift in Sources */, - 37BF48742D086A6C0013669A /* SmemeLoadingView.swift in Sources */, 4AB7C9302B78B44500845733 /* LoginBottomSheetViewController.swift in Sources */, 4A08480E2B555FD0008327C7 /* AmplitudeConstant.swift in Sources */, 4A3774842A42E6EA00357DD1 /* ConfigConstant.swift in Sources */, @@ -1946,7 +1923,6 @@ 4A004D5B2B4EE29A003C8936 /* PushTestService.swift in Sources */, 379789052AAC706800C61EF4 /* SmeemNavigationFactory.swift in Sources */, 37DCA65D2A475B5100FF8F90 /* RandomTopicResponse.swift in Sources */, - 370BD0B82CFBF50C009560DB /* Double+.swift in Sources */, 4ABCBCCC2BDE8E44003138A8 /* MySummaryService.swift in Sources */, 371107DA2AC99099007A4AC2 /* KeyboardFollowingLayoutHandler.swift in Sources */, 37B123B62CEEE58E00ED973A /* DetailDiaryCoachedView.swift in Sources */, @@ -1954,10 +1930,10 @@ 4ABCBCE52BE25D82003138A8 /* TrainingPlanViewController.swift in Sources */, 4AB7C9192B75F9B500845733 /* GesturePublisher+.swift in Sources */, 37A574CC29FF990E00312453 /* UIViewController+.swift in Sources */, - 37BF485B2D08676A0013669A /* HighlightModifier.swift in Sources */, 4ABCBCEA2BE26079003138A8 /* TrainingPlanViewModel.swift in Sources */, 4A9E10E42A43468600295D07 /* BaseTargetType.swift in Sources */, 37A574C329FF6E9C00312453 /* Constant.swift in Sources */, + 377B3BF02CF613710086E0BC /* HighlightModifier.swift in Sources */, 4AC1D6832B4ED38200D39A98 /* OnboardingModel.swift in Sources */, 4AC705932BEA1E52003C5310 /* LanguageContainerView.swift in Sources */, 4A004D602B4EE2BD003C8936 /* MyPageAPI.swift in Sources */, @@ -2008,7 +1984,6 @@ 4ADA41772A556209001C0285 /* LoadingView.swift in Sources */, 4ADCA2D62A9272E9002904EB /* EditAlarmViewController.swift in Sources */, 4A004D592B4EE28D003C8936 /* PushTestAPI.swift in Sources */, - 37BF48772D086A8B0013669A /* SmemeToastView.swift in Sources */, 6F294A432A26179700856CC8 /* ServiceAcceptViewController.swift in Sources */, 4AD04B402A1921AE004B7A58 /* CorrectionViewController.swift in Sources */, 4A1882FA2A8BBD0D0088F590 /* SmeemStartViewController.swift in Sources */, @@ -2050,7 +2025,6 @@ 6F294A422A26178C00856CC8 /* UserNickNameViewController.swift in Sources */, 4AC047252A8FCAE100EBDC0E /* AuthManagementViewController.swift in Sources */, 374FAF812A2CACCF00237A1A /* DiaryViewController.swift in Sources */, - 37BF485E2D0867DC0013669A /* CoachingResponse.swift in Sources */, 37DCA65A2A47598700FF8F90 /* RandomTopicService.swift in Sources */, 4AB7C9262B78914100845733 /* SplashViewModel.swift in Sources */, 4AF7C2312BFB7A4F00E8C6CD /* MyPlanDeactiveCollectionViewCell.swift in Sources */, @@ -2287,7 +2261,7 @@ CODE_SIGN_ENTITLEMENTS = "Smeem-iOS/Smeem-iOS.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20240811; + CURRENT_PROJECT_VERSION = 20241203; DEVELOPMENT_TEAM = K8LLWYQWXD; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "Smeem-iOS/Info.plist"; From 123dae5d9b66f7fbb2032a4de744dde8c8ccfc87 Mon Sep 17 00:00:00 2001 From: cchanmi <113524@naver.com> Date: Wed, 11 Dec 2024 00:29:18 +0900 Subject: [PATCH 03/10] =?UTF-8?q?[FEAT]=20#239=20-=20coaching=20amplitude?= =?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 --- .../Global/Constants/AmplitudeConstant.swift | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift b/Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift index e7fb3f56..0f513981 100644 --- a/Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift +++ b/Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift @@ -186,19 +186,24 @@ enum AmplitudeConstant { } enum coaching { - case coaching_try_click - case coaching_exit_click + case coaching_try_click(Bool) + case coaching_exit_click(Bool) case coaching_load_view case coaching_result_view - case coaching_feedback_view + case coaching_feedback_view(Int) var event: BaseEvent { switch self { - case .achievement_view: - return BaseEvent(eventType: "achievement_view", eventProperties: nil) - case .badge_bottom_sheet_view(let type, let hasBadge): - return BaseEvent(eventType: "badge_bottom_sheet_view", eventProperties: ["BadgeType":type, - "hasBadge":hasBadge]) + case .coaching_try_click(let isActive): + return BaseEvent(eventType: "coaching_try_click", eventProperties: ["active": isActive]) + case .coaching_exit_click(let isActive): + return BaseEvent(eventType: "coaching_exit_click", eventProperties: ["active": isActive]) + case .coaching_load_view: + return BaseEvent(eventType: "coaching_load_view", eventProperties: nil) + case .coaching_result_view: + return BaseEvent(eventType: "coaching_result_view", eventProperties: nil) + case .coaching_feedback_view(let index): + return BaseEvent(eventType: "badge_bottom_sheet_view", eventProperties: ["Index": index]) } } } From ad2d86ba7f1428669d124271bfa5316b596e2426 Mon Sep 17 00:00:00 2001 From: cchanmi <113524@naver.com> Date: Wed, 11 Dec 2024 01:01:55 +0900 Subject: [PATCH 04/10] =?UTF-8?q?[FEAT]=20#239=20-=20Coaching=20Amplitude?= =?UTF-8?q?=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/CoachingCompleteView.swift | 7 ++--- .../Coaching/Store/CoachingStore.swift | 29 +++++++++++++++++-- .../Coaching/View/CoachingView.swift | 12 ++++++++ 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/Smeem-iOS/Smeem-iOS/Presentation/Coaching/Components/CoachingCompleteView.swift b/Smeem-iOS/Smeem-iOS/Presentation/Coaching/Components/CoachingCompleteView.swift index 77b9d86b..f44c2af3 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/Coaching/Components/CoachingCompleteView.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/Coaching/Components/CoachingCompleteView.swift @@ -10,7 +10,6 @@ import SwiftUI struct CoachingCompleteView: View { @Binding var coachingAppData: CoachingAppData - @State var currentIndex = 0 var body: some View { @@ -31,7 +30,7 @@ struct CoachingCompleteView: View { .modifier(HighlightModifier( diaryText: coachingAppData.diaryText, corrections: coachingAppData.corrections, - highlightIndex: currentIndex + highlightIndex: coachingAppData.currentIndex )) .font(Font.custom("Pretendard", size: 16)) .foregroundColor(Color(UIColor.gray400)) @@ -50,7 +49,7 @@ struct CoachingCompleteView: View { Rectangle() .frame(height: 8) .foregroundStyle(Color(UIColor.gray100)) - TabView(selection: $currentIndex) { + TabView(selection: $coachingAppData.currentIndex) { ForEach(coachingAppData.corrections.indices, id: \.self) { item in ScrollView { VStack(spacing: 8) { @@ -64,7 +63,7 @@ struct CoachingCompleteView: View { .frame(width: screenWidth, height: screenHeight * (326/screenHeight), alignment: .top) .tabViewStyle(.page(indexDisplayMode: .never)) - PageControl(currentPage: $currentIndex, + PageControl(currentPage: $coachingAppData.currentIndex, coachingResponse: $coachingAppData.corrections) } } diff --git a/Smeem-iOS/Smeem-iOS/Presentation/Coaching/Store/CoachingStore.swift b/Smeem-iOS/Smeem-iOS/Presentation/Coaching/Store/CoachingStore.swift index 6ba652f1..5b85e9d5 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/Coaching/Store/CoachingStore.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/Coaching/Store/CoachingStore.swift @@ -8,11 +8,20 @@ import Foundation struct CoachingAppData { + var currentIndex: Int var diaryText: String var corrections: [CoachingResponse] var correctResultText: String } +enum CoachingAmplitude { + case coachingButtonTapped(Bool) + case exitButtonTapped(Bool) + case coachingLoading + case coachingResult + case coachingSwipe(Int) +} + final class CoachingStore: Store, ObservableObject { var service: CoachingServiceProtocol @@ -27,11 +36,13 @@ final class CoachingStore: Store, ObservableObject { enum Action { case detailDiaryAPI(diaryID: Int) case coachingButton(diaryID: Int) + case amplitudeInput(type: CoachingAmplitude) } struct State { var detailDiaryResponse = DetailDiaryResponse.empty - var coachingAppData = CoachingAppData(diaryText: "", + var coachingAppData = CoachingAppData(currentIndex: 0, + diaryText: "", corrections: CoachingsResponse.sample.corrections, correctResultText: "첨삭 중이에요") var toastErrorMessage: SmeemError? = nil @@ -63,7 +74,8 @@ final class CoachingStore: Store, ObservableObject { do { state.hiddenIndex += 1 let coachingResponse = try await service.coachingPostAPI(diaryID: ID) - state.coachingAppData = CoachingAppData(diaryText: combineCorrectionText(coachingResponse.corrections), + state.coachingAppData = CoachingAppData(currentIndex: 0, + diaryText: combineCorrectionText(coachingResponse.corrections), corrections: filiterCorrection(coachingResponse.corrections), correctResultText: correctTextResult(coachingResponse.corrections.count)) state.hiddenIndex += 1 @@ -73,6 +85,19 @@ final class CoachingStore: Store, ObservableObject { state.hiddenIndex = 0 } } + case .amplitudeInput(let type): + switch type { + case .coachingButtonTapped(let isActive): + AmplitudeManager.shared.track(event: AmplitudeConstant.coaching.coaching_try_click(isActive).event) + case .exitButtonTapped(let isActive): + AmplitudeManager.shared.track(event: AmplitudeConstant.coaching.coaching_exit_click(isActive).event) + case .coachingLoading: + AmplitudeManager.shared.track(event: AmplitudeConstant.coaching.coaching_load_view.event) + case .coachingResult: + AmplitudeManager.shared.track(event: AmplitudeConstant.coaching.coaching_result_view.event) + case .coachingSwipe(let index): + AmplitudeManager.shared.track(event: AmplitudeConstant.coaching.coaching_feedback_view(index+1).event) + } } } diff --git a/Smeem-iOS/Smeem-iOS/Presentation/Coaching/View/CoachingView.swift b/Smeem-iOS/Smeem-iOS/Presentation/Coaching/View/CoachingView.swift index 1d330497..a1f27ac1 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/Coaching/View/CoachingView.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/Coaching/View/CoachingView.swift @@ -19,6 +19,7 @@ struct CoachingView: View { HStack() { Spacer() Button(action: { + store.send(action: .amplitudeInput(type: .exitButtonTapped(store.state.isEnabled))) let homeVC = HomeViewController() homeVC.handlePostDiaryAPI(with: store.state.diaryResponse) changeRootViewController(homeVC) @@ -37,6 +38,7 @@ struct CoachingView: View { Button(action: { if store.state.isEnabled { store.send(action: .coachingButton(diaryID: store.state.diaryResponse.diaryID)) + store.send(action: .amplitudeInput(type: .coachingButtonTapped(store.state.isEnabled))) } }) { HStack { @@ -77,6 +79,9 @@ struct CoachingView: View { LottieView("smeemLoading") .loopMode(.loop) .frame(width: screenWidth, height: 164, alignment: .center) + .onAppear { + store.send(action: .amplitudeInput(type: .coachingLoading)) + } Text("AI 코치가 내 일기를 분석하고 있어요\n잠시만 기다려주세요") .font(Font.custom("Pretendard", size: 16)) @@ -87,6 +92,13 @@ struct CoachingView: View { // MARK: 첨삭 화면 } else { CoachingCompleteView(coachingAppData: $store.state.coachingAppData) + .onAppear { + store.send(action: .amplitudeInput(type: .coachingResult)) + store.send(action: .amplitudeInput(type: .coachingSwipe(1))) + } + .onChange(of: store.state.coachingAppData.currentIndex) { index in + store.send(action: .amplitudeInput(type: .coachingSwipe(index))) + } } // MARK: 첫 진입시 토스트뷰 실행 From 585ffa248dddd18d4e2312db26bba533e71a0a20 Mon Sep 17 00:00:00 2001 From: cchanmi <113524@naver.com> Date: Wed, 11 Dec 2024 23:27:00 +0900 Subject: [PATCH 05/10] =?UTF-8?q?[CHORE]=20#239=20-=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=20=ED=8C=9D=EC=97=85=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Splah/ViewModel/SplashViewModel.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift b/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift index 1949b5f1..695fa664 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift @@ -147,5 +147,23 @@ extension SplashViewModel { return false } } + + func checkVersion2(client: String, now: String, force: String) -> Bool { + let clientVersion = client.split(separator: ".").map{$0} + let nowVersion = now.split(separator: ".").map{$0} + let forceVersion = force.split(separator: ".").map{$0} + + // x 버전이 더 크면 강제 업데이트 + if forceVersion[0] > clientVersion[0] { + return true + // x 버전이 같고, y 버전이 더 크면 강제 업데이트 + } else if forceVersion[0] == clientVersion[0] && forceVersion[1] > clientVersion[1] { + return true + // x, y 버전이 같고, z버전이 더 크면 강제 업데이트 + } else if (forceVersion[0] == clientVersion[0] && forceVersion[1] > clientVersion[1]) && forceVersion[2] > clientVersion[2] { + return true + } + return false + } } From e765d2e7d147eb0a914b8d35adced90fa6237638 Mon Sep 17 00:00:00 2001 From: Joon Baek Date: Thu, 12 Dec 2024 12:18:24 +0900 Subject: [PATCH 06/10] =?UTF-8?q?[Fix]=20#239=20-=20SegmentedControl=20?= =?UTF-8?q?=ED=8F=B0=ED=8A=B8=20=EA=B9=A8=EC=A7=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/UIComponents/SwiftUI/CustomSegmentedControl.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Smeem-iOS/Smeem-iOS/Global/UIComponents/SwiftUI/CustomSegmentedControl.swift b/Smeem-iOS/Smeem-iOS/Global/UIComponents/SwiftUI/CustomSegmentedControl.swift index 7c18cfa4..52eabd3f 100644 --- a/Smeem-iOS/Smeem-iOS/Global/UIComponents/SwiftUI/CustomSegmentedControl.swift +++ b/Smeem-iOS/Smeem-iOS/Global/UIComponents/SwiftUI/CustomSegmentedControl.swift @@ -49,7 +49,7 @@ struct SegmentButton: View { .foregroundColor(foregroundColor) .font(Font(UIFont.c5)) // .lineLimit(1) -// .minimumScaleFactor(0.9) + .minimumScaleFactor(0.9) .overlay( Group { if isSelected && isFirstButton { From 25dc06048a08604eaee693b5afcf747e45b06955 Mon Sep 17 00:00:00 2001 From: Joon Baek Date: Thu, 12 Dec 2024 15:45:46 +0900 Subject: [PATCH 07/10] =?UTF-8?q?[Feat]=20#239=20-=20=EC=9D=BC=EA=B8=B0=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=EB=B3=B4=EA=B8=B0=20=EC=95=B0=ED=94=8C?= =?UTF-8?q?=EB=A6=AC=ED=8A=9C=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailDiary/DetailDiaryCoachedView.swift | 16 ++++++++++++++++ .../DetailDiary/DetailDiaryViewController.swift | 1 - .../Controllers/EditDiaryViewController.swift | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Smeem-iOS/Smeem-iOS/Presentation/DetailDiary/DetailDiaryCoachedView.swift b/Smeem-iOS/Smeem-iOS/Presentation/DetailDiary/DetailDiaryCoachedView.swift index 30fa5300..8d11396f 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/DetailDiary/DetailDiaryCoachedView.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/DetailDiary/DetailDiaryCoachedView.swift @@ -32,6 +32,9 @@ struct DetailDiaryCoachedView: View { @State private var toastErrorMessage: SmeemError? = nil var toastMessage: SmeemToast? = .completed + var hasCorrections: Bool { + return !(response?.corrections.isEmpty ?? true) + } @Environment(\.dismiss) private var dismiss private let detailDiaryService = DetailDiaryService.shared @@ -67,6 +70,9 @@ struct DetailDiaryCoachedView: View { navigateToEditDiary() } } + .onTapGesture { + AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.mydiary_edit(hasCorrections).event) + } Button("삭제하기", role: .destructive) { deleteDiaryWithAPI(diaryID: diaryID ?? 0) @@ -115,10 +121,15 @@ struct DetailDiaryCoachedView: View { } } .onAppear { + AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.mydiary_view(hasCorrections).event) Task { await fetchCoachingData(diaryID: diaryID ?? 0) } } + .onChange(of: selectedIndex) { newValue in + AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.toggle_click(convertSelectedIndexToString(newValue)).event + ) + } .overlay { if isLoading { SmemeEmptyView() @@ -154,10 +165,15 @@ extension DetailDiaryCoachedView { editVC.diaryID = self.diaryID ?? 0 editVC.randomContent = self.randomTopic editVC.diaryTextView.text = self.diaryContent + editVC.hasCoached = self.hasCorrections editVC.randomSubjectView.setData(contentText: self.randomTopic) self.pushToUIKitView(editVC) } + private func convertSelectedIndexToString(_ index: Int) -> String { + return index == 0 ? "코칭 OFF" : "코칭 ON" + } + @MainActor private func fetchCoachingData(diaryID: Int) async { isLoading = true diff --git a/Smeem-iOS/Smeem-iOS/Presentation/DetailDiary/DetailDiaryViewController.swift b/Smeem-iOS/Smeem-iOS/Presentation/DetailDiary/DetailDiaryViewController.swift index 2d067606..80bad1d1 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/DetailDiary/DetailDiaryViewController.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/DetailDiary/DetailDiaryViewController.swift @@ -82,7 +82,6 @@ extension DetailDiaryViewController { @objc func showActionSheet() { let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) let modifyAction = UIAlertAction (title: "수정", style: .default, handler: { (action) in - AmplitudeManager.shared.track(event: AmplitudeConstant.diaryDetail.mydiary_edit.event) let editVC = EditDiaryViewController() editVC.diaryID = self.diaryId editVC.randomContent = self.isRandomTopic diff --git a/Smeem-iOS/Smeem-iOS/Presentation/Diaries/View/Controllers/EditDiaryViewController.swift b/Smeem-iOS/Smeem-iOS/Presentation/Diaries/View/Controllers/EditDiaryViewController.swift index c08adbab..896841ee 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/Diaries/View/Controllers/EditDiaryViewController.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/Diaries/View/Controllers/EditDiaryViewController.swift @@ -15,6 +15,7 @@ final class EditDiaryViewController: BaseViewController { var diaryID = Int() var randomContent = String() + var hasCoached = Bool() // MARK: - UI Property @@ -169,6 +170,7 @@ extension EditDiaryViewController { func patchDiaryAPI() { PostDiaryAPI.shared.patchDiary(param: PatchDiaryRequest(content: diaryTextView.text), diaryID: diaryID) { response in DispatchQueue.main.async { + AmplitudeConstant.diaryDetail.mydiary_edit_complete_click(self.hasCoached).event self.changeRootViewControllerAndPresent(HomeViewController()) } } From a33d334e0a39a0bb3c8ebdccd7734e69247a1837 Mon Sep 17 00:00:00 2001 From: cchanmi <113524@naver.com> Date: Thu, 12 Dec 2024 15:58:14 +0900 Subject: [PATCH 08/10] =?UTF-8?q?[TEST]=20#239=20-=20detail=20diary=20test?= =?UTF-8?q?=20code=20model=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/DetailDiary/DetailDiaryEndPoint.swift | 1 + .../DetailDiary/DetailDiaryResponse.swift | 20 ------------------- .../Service/CoachingServiceTest.swift | 1 + .../Coaching/Store/CoachingStoreTest.swift | 8 ++++---- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/Smeem-iOS/Smeem-iOS/Network/API/DetailDiary/DetailDiaryEndPoint.swift b/Smeem-iOS/Smeem-iOS/Network/API/DetailDiary/DetailDiaryEndPoint.swift index e096fc93..d4753066 100644 --- a/Smeem-iOS/Smeem-iOS/Network/API/DetailDiary/DetailDiaryEndPoint.swift +++ b/Smeem-iOS/Smeem-iOS/Network/API/DetailDiary/DetailDiaryEndPoint.swift @@ -55,6 +55,7 @@ extension DetailDiaryEndPoint { "content": "일기 내용입니다", "createdAt": "2024년 5월 18일", "username": "찬미", + "isUpdated": true, "corrections": [ { "originalSentence": "original text", diff --git a/Smeem-iOS/Smeem-iOS/Network/NetworkDataModel/DetailDiary/DetailDiaryResponse.swift b/Smeem-iOS/Smeem-iOS/Network/NetworkDataModel/DetailDiary/DetailDiaryResponse.swift index 971a6baa..16bbe79e 100644 --- a/Smeem-iOS/Smeem-iOS/Network/NetworkDataModel/DetailDiary/DetailDiaryResponse.swift +++ b/Smeem-iOS/Smeem-iOS/Network/NetworkDataModel/DetailDiary/DetailDiaryResponse.swift @@ -21,12 +21,6 @@ struct DetailDiaryResponse: Codable, Equatable { } } -//struct CorrentionsData: Codable { -// let correntionId: Int -// let before: String -// let after: String -//} - extension DetailDiaryResponse { static let empty = DetailDiaryResponse(diaryId: 0, topic: "", content: "테스트임?", createdAt: "그래", username: "그래", isUpdated: true, corrections: [CoachingResponse(originalSentence: "I have went to the park yesterdayI have went to the park yesterdayI have went to the park yesterdayI have went to the park yesterday", correctedSentence: "I went to the park yesterdayI went to the park yesterdayI went to the park yesterdayI went to the park yesterdayI went to the park yesterday", @@ -37,17 +31,3 @@ extension DetailDiaryResponse { reason: "이러 이러한 이유로 이건 맞습니다", isCorrected: true)], correctionCount: 0, correctionMaxCount: 0) } - -//struct CoachingResponse: Codable, Equatable { -// let originalSentence: String -// let correctedSentence: String -// let reason: String -// let isCorrected: Bool -// -// enum CodingKeys: String, CodingKey { -// case originalSentence = "originalSentence" -// case correctedSentence = "correctedSentence" -// case reason -// case isCorrected = "isCorrected" -// } -//} diff --git a/Smeem-iOS/Smeem-iOSTests/Coaching/Service/CoachingServiceTest.swift b/Smeem-iOS/Smeem-iOSTests/Coaching/Service/CoachingServiceTest.swift index cf154ba6..8be821d0 100644 --- a/Smeem-iOS/Smeem-iOSTests/Coaching/Service/CoachingServiceTest.swift +++ b/Smeem-iOS/Smeem-iOSTests/Coaching/Service/CoachingServiceTest.swift @@ -51,6 +51,7 @@ extension CoachingServiceTest { content: "일기 내용입니다", createdAt: "2024년 5월 18일", username: "찬미", + isUpdated: true, corrections: [CoachingResponse(originalSentence: "original text", correctedSentence: "corrected text", reason: "수정된 문구입니다.", diff --git a/Smeem-iOS/Smeem-iOSTests/Coaching/Store/CoachingStoreTest.swift b/Smeem-iOS/Smeem-iOSTests/Coaching/Store/CoachingStoreTest.swift index f03c754c..cc408a58 100644 --- a/Smeem-iOS/Smeem-iOSTests/Coaching/Store/CoachingStoreTest.swift +++ b/Smeem-iOS/Smeem-iOSTests/Coaching/Store/CoachingStoreTest.swift @@ -59,7 +59,7 @@ final class CoachingStoreTest: XCTestCase { isCorrected: false)) } - var expectedResult = [CoachingResponse]() + let expectedResult = [CoachingResponse]() // When let outputResult = sut.filiterCorrection(filterResult) @@ -71,14 +71,14 @@ final class CoachingStoreTest: XCTestCase { func test_원문일기_잘조합해주는지() { // Given var filterResult = [CoachingResponse]() - for i in 1...3 { - filterResult.append(CoachingResponse(originalSentence: "안녕", + for _ in 1...3 { + filterResult.append(CoachingResponse(originalSentence: "테스트", correctedSentence: "", reason: "", isCorrected: false)) } - var expectedResult = "안녕 안녕 안녕" + let expectedResult = "테스트 테스트 테스트" // When let outputResult = sut.combineCorrectionText(filterResult) From 69905b7723e8e0060daec793bde53290d186985b Mon Sep 17 00:00:00 2001 From: cchanmi <113524@naver.com> Date: Thu, 12 Dec 2024 16:03:00 +0900 Subject: [PATCH 09/10] =?UTF-8?q?[CHORE]=20#239=20-=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=20=EB=B2=84=EC=A0=84=20=EB=B0=8F=20=EB=B9=8C?= =?UTF-8?q?=EB=93=9C=20=EB=B2=84=EC=A0=84=20=EA=B4=80=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj | 6 ++-- .../Splah/ViewModel/SplashViewModel.swift | 35 +++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj b/Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj index 4c28789a..cb6df42b 100644 --- a/Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj +++ b/Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj @@ -2277,7 +2277,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 3.0.0; PRODUCT_BUNDLE_IDENTIFIER = "Team.Smeem-dev"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -2299,7 +2299,7 @@ CODE_SIGN_ENTITLEMENTS = "Smeem-iOS/Smeem-iOS.entitlements"; CODE_SIGN_IDENTITY = "Apple Distribution: YuJi Lee (K8LLWYQWXD)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 20241031; + CURRENT_PROJECT_VERSION = 2024121201; DEVELOPMENT_TEAM = K8LLWYQWXD; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "Smeem-iOS/Info.plist"; @@ -2315,7 +2315,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 2.0.3; + MARKETING_VERSION = 3.0.0; PRODUCT_BUNDLE_IDENTIFIER = "Team.Smeem-iOS"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = smeem_release; diff --git a/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift b/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift index 695fa664..201630f9 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift @@ -52,7 +52,6 @@ final class SplashViewModel: ViewModel { switch result { case .success(let response): if self.checkVersion(client: self.appVersion, - now: response.iosVersion.version, force: response.iosVersion.forceVersion) { promise(.success(UpdateTextModel(title: response.title, @@ -133,24 +132,8 @@ final class SplashViewModel: ViewModel { } extension SplashViewModel { - func checkVersion(client: String, now: String, force: String) -> Bool { + func checkVersion(client: String, force: String) -> Bool { let clientVersion = client.split(separator: ".").map{$0} - let nowVersion = now.split(separator: ".").map{$0} - let forceVersion = force.split(separator: ".").map{$0} - - // force가 크고 현재 앱 버전이랑 now랑 다를 때 -> 강업 - if forceVersion[0] > clientVersion[0] && clientVersion != nowVersion { - return true - } else { - // force가 크고, 현재 앱 버전이랑 now랑 같을 때 -> 강업하고 온 유저 - // force가 안 큼 -> 강업할 필요 없는 상태 - return false - } - } - - func checkVersion2(client: String, now: String, force: String) -> Bool { - let clientVersion = client.split(separator: ".").map{$0} - let nowVersion = now.split(separator: ".").map{$0} let forceVersion = force.split(separator: ".").map{$0} // x 버전이 더 크면 강제 업데이트 @@ -165,5 +148,21 @@ extension SplashViewModel { } return false } + + func checkVersion2(client: String, now: String, force: String) -> Bool { + let clientVersion = client.split(separator: ".").map{$0} + let nowVersion = now.split(separator: ".").map{$0} + let forceVersion = force.split(separator: ".").map{$0} + + // force가 크고 현재 앱 버전이랑 now랑 다를 때 -> 강업 + if forceVersion[0] > clientVersion[0] && clientVersion != nowVersion { + return true + } else { + // force가 크고, 현재 앱 버전이랑 now랑 같을 때 -> 강업하고 온 유저 + // force가 안 큼 -> 강업할 필요 없는 상태 + return false + } + } + } From 8ad8e0f825d0b334672a9e3818e52ce1cfa5d473 Mon Sep 17 00:00:00 2001 From: cchanmi <113524@naver.com> Date: Thu, 12 Dec 2024 16:19:29 +0900 Subject: [PATCH 10/10] =?UTF-8?q?[TEST]=20#239=20-=20=EA=B0=95=EC=A0=9C=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Splash/Splah/ViewModel/SplashViewModel.swift | 2 +- .../Onboarding/ViewModel/SplashViewModelTest.swift | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift b/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift index 201630f9..f1cc663e 100644 --- a/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift +++ b/Smeem-iOS/Smeem-iOS/Presentation/Splash/Splah/ViewModel/SplashViewModel.swift @@ -10,7 +10,7 @@ import Combine final class SplashViewModel: ViewModel { - private let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String + let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as! String struct Input { let checkUpdatePopup: PassthroughSubject diff --git a/Smeem-iOS/Smeem-iOSTests/Onboarding/ViewModel/SplashViewModelTest.swift b/Smeem-iOS/Smeem-iOSTests/Onboarding/ViewModel/SplashViewModelTest.swift index 0e784a7d..24f72215 100644 --- a/Smeem-iOS/Smeem-iOSTests/Onboarding/ViewModel/SplashViewModelTest.swift +++ b/Smeem-iOS/Smeem-iOSTests/Onboarding/ViewModel/SplashViewModelTest.swift @@ -14,15 +14,17 @@ final class SplashViewModelTest: XCTestCase { private var viewModel: SplashViewModel! private var mockService: SplashServiceMock! + private var appVersion: String! override func setUpWithError() throws { self.mockService = SplashServiceMock() self.viewModel = SplashViewModel(provider: mockService) + self.appVersion = viewModel.appVersion } func test_강제업데이트안한유저_정확한데이터_return하는지() { // Given - let result = self.viewModel.checkVersion(client: "2.0.0", now: "2.0.1", force: "3.0.0") + let result = self.viewModel.checkVersion(client: "2.0.3", force: "3.0.0") // When let expectedResult = true @@ -33,7 +35,7 @@ final class SplashViewModelTest: XCTestCase { func test_강제업데이트로하고온유저_정확한데이터_return하는지() { // Given - let result = self.viewModel.checkVersion(client: "2.0.1", now: "2.0.1", force: "3.0.0") + let result = self.viewModel.checkVersion(client: self.appVersion, force: "3.0.0") // When let expectedResult = false @@ -42,12 +44,12 @@ final class SplashViewModelTest: XCTestCase { XCTAssertEqual(result, expectedResult) } - func test_강제업데이트하지않아도되는유저_정확한데이터_return하는지() { + func test_이전업데이트로직유저_강제업데이트팝업잘뜨는지() { // Given - let result = self.viewModel.checkVersion(client: "2.0.1", now: "2.0.1", force: "2.0.0") + let result = self.viewModel.checkVersion2(client: "2.0.3", now: "2.0.4", force: "3.0.0") // When - let expectedResult = false + let expectedResult = true // Then XCTAssertEqual(result, expectedResult)