Skip to content

Commit

Permalink
Merge pull request #243 from Team-Smeme/develop
Browse files Browse the repository at this point in the history
[TEST] 일기 코칭 및 상세 코칭 기능 테스트 플라이트 등록
  • Loading branch information
cchanmi authored Dec 12, 2024
2 parents be993f2 + 537cc7c commit 8963e70
Show file tree
Hide file tree
Showing 38 changed files with 1,123 additions and 801 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/smeemDev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ name: Swift
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

jobs:
build:
Expand Down
38 changes: 14 additions & 24 deletions Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
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 */; };
Expand Down Expand Up @@ -263,6 +264,7 @@
374F828B2AC327A200C128B9 /* SmeemTextViewHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmeemTextViewHandler.swift; sourceTree = "<group>"; };
374FAF802A2CACCF00237A1A /* DiaryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiaryViewController.swift; sourceTree = "<group>"; };
3761116B2A278D0E0095EC5A /* String+.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+.swift"; sourceTree = "<group>"; };
376947882D0894A2006A46B1 /* Double+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Double+.swift"; sourceTree = "<group>"; };
377B3BEF2CF613710086E0BC /* HighlightModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HighlightModifier.swift; sourceTree = "<group>"; };
378B20ED2BA0A01600604935 /* ForeignDiaryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForeignDiaryViewModel.swift; sourceTree = "<group>"; };
378B20EF2BA0A02400604935 /* StepOneKoreanDiaryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepOneKoreanDiaryViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -446,23 +448,10 @@
A3D7ECB62A26566A009857D6 /* EditNicknameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditNicknameViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
370BD0B62CFB660C009560DB /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
CoachingComparisonView.swift,
CoachingCompletedView.swift,
CoachingExplanationView.swift,
CustomSegmentedControl.swift,
SwiftUINavigationView.swift,
);
target = 4A8FFA4B29C9E1FD00FB76C0 /* Smeem-iOS */;
};
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
377B3BF12CF618B90086E0BC /* SwiftUI */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = SwiftUI; sourceTree = "<group>"; };
4AB3494D2CF229D10047C484 /* UIViewConponent */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (370BD0B62CFB660C009560DB /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = UIViewConponent; sourceTree = "<group>"; };
4A17370E2D05C02E00B772C3 /* Toast */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Toast; sourceTree = "<group>"; };
4A17370F2D05C03600B772C3 /* LoadingView */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = LoadingView; sourceTree = "<group>"; };
4AB3494E2CF22A070047C484 /* Global */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Global; sourceTree = "<group>"; };
4AB3494F2CF22A250047C484 /* Button */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Button; sourceTree = "<group>"; };
4AB349502CF22A2E0047C484 /* TextView */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = TextView; sourceTree = "<group>"; };
Expand All @@ -473,7 +462,6 @@
4AB349BA2CF23B770047C484 /* Coaching */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Coaching; sourceTree = "<group>"; };
4AB349BC2CF23D210047C484 /* Coaching */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Coaching; sourceTree = "<group>"; };
4AF050CE2CE9DE010055BC3F /* Coaching */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Coaching; sourceTree = "<group>"; };
4AF050D72CEA01E20055BC3F /* DiaryComplete */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = DiaryComplete; sourceTree = "<group>"; };
4AF050D82CEA01EA0055BC3F /* Coaching */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Coaching; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */

Expand Down Expand Up @@ -574,6 +562,7 @@
373D29912CBFE16B00A559A3 /* SwiftUI */ = {
isa = PBXGroup;
children = (
377B3BEF2CF613710086E0BC /* HighlightModifier.swift */,
373D29922CBFE17B00A559A3 /* View+.swift */,
);
path = SwiftUI;
Expand Down Expand Up @@ -618,7 +607,6 @@
37A574B929FE209F00312453 /* Resources */,
4AC4B82B2A2F9F5300E147AA /* Constants */,
37EB69E42A4B3B6B00075E4E /* Protocols */,
377B3BEF2CF613710086E0BC /* HighlightModifier.swift */,
);
path = Global;
sourceTree = "<group>";
Expand All @@ -627,7 +615,6 @@
isa = PBXGroup;
children = (
4AF050D82CEA01EA0055BC3F /* Coaching */,
4AF050D72CEA01E20055BC3F /* DiaryComplete */,
4AC047232A8FCA9700EBDC0E /* AuthManagement */,
4AA6FEE72C3ABD7C00E588E9 /* ResignSummray */,
4AA5E4B52BF24CEB00F308C8 /* BadgeBottomSheet */,
Expand Down Expand Up @@ -666,6 +653,7 @@
4A4FEB002B721956001BBDF3 /* Combine+.swift */,
4AB7C9182B75F9B500845733 /* GesturePublisher+.swift */,
4AF050EA2CEA300F0055BC3F /* MoyaProvier+.swift */,
376947882D0894A2006A46B1 /* Double+.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand All @@ -674,7 +662,6 @@
isa = PBXGroup;
children = (
377B3BF12CF618B90086E0BC /* SwiftUI */,
4AB3494D2CF229D10047C484 /* UIViewConponent */,
371107DB2ACAB4E3007A4AC2 /* Base */,
4A1EE9552A4DFB86007BFEF3 /* SmeemComponent */,
);
Expand Down Expand Up @@ -1018,6 +1005,8 @@
4A1EE9552A4DFB86007BFEF3 /* SmeemComponent */ = {
isa = PBXGroup;
children = (
4A17370F2D05C03600B772C3 /* LoadingView */,
4A17370E2D05C02E00B772C3 /* Toast */,
4AB349502CF22A2E0047C484 /* TextView */,
4AB3494F2CF22A250047C484 /* Button */,
4AB3494E2CF22A070047C484 /* Global */,
Expand Down Expand Up @@ -1752,7 +1741,8 @@
);
fileSystemSynchronizedGroups = (
377B3BF12CF618B90086E0BC /* SwiftUI */,
4AB3494D2CF229D10047C484 /* UIViewConponent */,
4A17370E2D05C02E00B772C3 /* Toast */,
4A17370F2D05C03600B772C3 /* LoadingView */,
4AB3494E2CF22A070047C484 /* Global */,
4AB3494F2CF22A250047C484 /* Button */,
4AB349502CF22A2E0047C484 /* TextView */,
Expand All @@ -1762,7 +1752,6 @@
4AB349562CF22BFF0047C484 /* EditUser */,
4AB349BA2CF23B770047C484 /* Coaching */,
4AF050CE2CE9DE010055BC3F /* Coaching */,
4AF050D72CEA01E20055BC3F /* DiaryComplete */,
4AF050D82CEA01EA0055BC3F /* Coaching */,
);
name = "Smeem-iOS";
Expand Down Expand Up @@ -1895,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 */,
Expand Down Expand Up @@ -2287,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 = "";
Expand All @@ -2309,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";
Expand All @@ -2325,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;
Expand Down
38 changes: 35 additions & 3 deletions Smeem-iOS/Smeem-iOS/Global/Constants/AmplitudeConstant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}
}
Expand Down Expand Up @@ -175,4 +184,27 @@ enum AmplitudeConstant {
}
}
}

enum coaching {
case coaching_try_click(Bool)
case coaching_exit_click(Bool)
case coaching_load_view
case coaching_result_view
case coaching_feedback_view(Int)

var event: BaseEvent {
switch self {
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])
}
}
}
}
20 changes: 20 additions & 0 deletions Smeem-iOS/Smeem-iOS/Global/Extensions/Double+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Double+.swift
// Smeem-iOS
//
// Created by Joon Baek on 12/1/24.
//

import UIKit

extension Double {
// 너비 기반 스케일링 (iPhone 13 mini)
func scaledByWidth() -> Double {
return (self / 375) * UIScreen.main.bounds.width
}

// 높이 기반 스케일링 (iPhone 13 mini)
func scaledByHeight() -> Double {
return (self / 812) * UIScreen.main.bounds.height
}
}
72 changes: 71 additions & 1 deletion Smeem-iOS/Smeem-iOS/Global/Extensions/SwiftUI/View+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,88 @@ extension View {
}

var screenHeight: Double {
return screenSize.height
return screenSize.height
}

var screenWidth: Double {
return screenSize.width
}

func showEditConfirmation(
title: String,
message: String,
firstActionTitle: String,
secondActionTitle: String,
firstActionHandler: (() -> Void)? = nil,
secondActionHandler: (() -> Void)? = nil
) {
let alert = UIAlertController(
title: title,
message: message,
preferredStyle: .alert
)

alert.addAction(UIAlertAction(title: firstActionTitle, style: .cancel) { _ in
// 현재 presenting view controller를 찾아서 dismiss
if let presentedViewController = UIApplication.shared.windows.first?.rootViewController?.presentedViewController {
presentedViewController.dismiss(animated: true) {
firstActionHandler?()
}
}
})

alert.addAction(UIAlertAction(title: secondActionTitle, style: .default) { _ in
secondActionHandler?()
})

if let topViewController = UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.rootViewController {
topViewController.present(alert, animated: true)
}
}

func changeRootViewController(_ viewController: UIViewController) {
guard let window = UIApplication.shared.windows.first else { return }
UIView.transition(with: window, duration: 0.5, options: .transitionCrossDissolve, animations: {
let rootVC = UINavigationController(rootViewController: viewController)
window.rootViewController = rootVC
})
}

func pushToUIKitView(_ viewController: UIViewController, dismissFullScreenCover: Bool = true) {
// 현재 presenting된 view controller
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let rootViewController = windowScene.windows.first?.rootViewController {

// 현재 최상위 view controller (fullScreenCover 아래의 view controller)
var topViewController = rootViewController
while let presentedViewController = topViewController.presentedViewController {
topViewController = presentedViewController
}

if let navigationController = topViewController as? UINavigationController {
navigationController.pushViewController(viewController, animated: true)

if dismissFullScreenCover,
let presentingView = topViewController.presentingViewController {
presentingView.dismiss(animated: false, completion: nil)
}
}
}
}

func changeRootViewControllerAndPresent(_ viewControllerToPresent: UIViewController) {
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first {

let navigationController = UINavigationController(rootViewController: viewControllerToPresent)
window.rootViewController = navigationController

UIView.transition(with: window,
duration: 0.5,
options: .transitionCrossDissolve,
animations: nil)

window.makeKeyAndVisible()
}
}
}
9 changes: 7 additions & 2 deletions Smeem-iOS/Smeem-iOS/Global/Extensions/UIViewController+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ extension UIViewController {

func changeRootViewControllerAndPresent(_ viewControllerToPresent: UIViewController) {
if let window = UIApplication.shared.windows.first {
window.rootViewController = viewControllerToPresent
UIView.transition(with: window, duration: 0.5, options: .transitionCrossDissolve, animations: nil)
let navigationController = UINavigationController(rootViewController: viewControllerToPresent)
window.rootViewController = navigationController

UIView.transition(with: window,
duration: 0.5,
options: .transitionCrossDissolve,
animations: nil)
} else {
viewControllerToPresent.modalPresentationStyle = .overFullScreen
self.present(viewControllerToPresent, animated: true, completion: nil)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// SmemeLoadingView.swift
// Smeem-iOS
//
// Created by 황찬미 on 11/26/24.
//

import SwiftUI

struct SmemeLoadingView: View {

var body: some View {
HStack {
Spacer()
VStack {
Spacer()
ProgressView()
Spacer()
}
Spacer()
}
.ignoresSafeArea()
.background(Color.white.opacity(0.1)) // 반투명 배경
.allowsHitTesting(true) // 로딩 중 터치 차단
}
}

struct SmemeEmptyView: View {

var body: some View {
ZStack {
Color.white.ignoresSafeArea()
}
.animation(.easeInOut(duration: 0.5), value: true) // 0.5초 뒤에 서서히 사라짐
}
}
Loading

0 comments on commit 8963e70

Please sign in to comment.