Skip to content

Commit

Permalink
Merge pull request #505 from DeveloperAcademy-POSTECH/feat/501-Announ…
Browse files Browse the repository at this point in the history
…cmentUpdate

UpdateInfoView 및 설문 기능 제작
  • Loading branch information
HanGyeongjun authored Nov 1, 2023
2 parents 25fa14b + 2996221 commit 467f71a
Show file tree
Hide file tree
Showing 21 changed files with 480 additions and 93 deletions.
24 changes: 18 additions & 6 deletions HappyAnding/HappyAnding.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@
A31F1844292A637300AF4A82 /* Date+String.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9CAEF822914855900224B0A /* Date+String.swift */; };
A31F1846292A638700AF4A82 /* (null) in Sources */ = {isa = PBXBuildFile; };
A31F1848292A64D700AF4A82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87E99C7128F94EA8009B691F /* Assets.xcassets */; };
A323D3CA2AEE870700DDA716 /* SuggestionForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = A323D3C92AEE870700DDA716 /* SuggestionForm.swift */; };
A323D3CC2AEEA10F00DDA716 /* SuggestionFormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A323D3CB2AEEA10F00DDA716 /* SuggestionFormViewModel.swift */; };
A323D3D02AEEE4B400DDA716 /* HapticManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A39504862AD46B9B0019895E /* HapticManager.swift */; };
A33F74AE2908D8C800B8D0D0 /* CheckBoxShortcutCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A33F74AD2908D8C800B8D0D0 /* CheckBoxShortcutCell.swift */; };
A3439AF529395A100043E273 /* UserAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87E606B729114FB200C3DA13 /* UserAuth.swift */; };
A3439AF629395A3A0043E273 /* CustomTextEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87276C372933F6AB00C92F4C /* CustomTextEditor.swift */; };
Expand All @@ -101,10 +104,10 @@
A365209B29B1F26C00E9B07A /* Image+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9AC2BB92935D34C00165820 /* Image+View.swift */; };
A3766B232904330300708F83 /* ReadCurationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3766B222904330300708F83 /* ReadCurationView.swift */; };
A38115BA292B447D0043E8B8 /* ShortcutCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A38115B9292B447D0043E8B8 /* ShortcutCardCell.swift */; };
A39504872AD46B9B0019895E /* HapticManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A39504862AD46B9B0019895E /* HapticManager.swift */; };
A38F3B1F2AE62E8D0036FCAC /* SuggestionFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A38F3B1E2AE62E8D0036FCAC /* SuggestionFormView.swift */; };
A39504882AD46B9B0019895E /* HapticManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A39504862AD46B9B0019895E /* HapticManager.swift */; };
A3A6AD1E292763E2004C49DC /* ShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A3A6AD14292763E2004C49DC /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
A3C404D62A23D0E800C3BA75 /* UpdateInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C404D52A23D0E800C3BA75 /* UpdateInfoView.swift */; };
A3C404D62A23D0E800C3BA75 /* AboutUpdateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C404D52A23D0E800C3BA75 /* AboutUpdateView.swift */; };
A3C5576C292BE084003907DC /* ShareExtensionWriteShortcutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C5576B292BE084003907DC /* ShareExtensionWriteShortcutView.swift */; };
A3FC4747292A61550058BF26 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = A3FC4746292A61550058BF26 /* FirebaseAnalytics */; };
A3FC4749292A61550058BF26 /* FirebaseAuth in Frameworks */ = {isa = PBXBuildFile; productRef = A3FC4748292A61550058BF26 /* FirebaseAuth */; };
Expand Down Expand Up @@ -274,6 +277,8 @@
A0DD085629276608008177BB /* URL+DeepLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+DeepLink.swift"; sourceTree = "<group>"; };
A0F822AB2910B8F100AF4448 /* ShortcutsZipViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortcutsZipViewModel.swift; sourceTree = "<group>"; };
A0F822B629164D2300AF4448 /* ListCategoryShortcutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListCategoryShortcutView.swift; sourceTree = "<group>"; };
A323D3C92AEE870700DDA716 /* SuggestionForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionForm.swift; sourceTree = "<group>"; };
A323D3CB2AEEA10F00DDA716 /* SuggestionFormViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionFormViewModel.swift; sourceTree = "<group>"; };
A33F74AD2908D8C800B8D0D0 /* CheckBoxShortcutCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckBoxShortcutCell.swift; sourceTree = "<group>"; };
A3439AFA2939B0E80043E273 /* UserDefaults+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefaults+Extension.swift"; sourceTree = "<group>"; };
A34BF82729AF3D55009BC946 /* AnnouncementCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnouncementCell.swift; sourceTree = "<group>"; };
Expand All @@ -284,11 +289,12 @@
A35DB3382927E9630011A28B /* CustomShareNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomShareNavigationController.swift; sourceTree = "<group>"; };
A3766B222904330300708F83 /* ReadCurationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadCurationView.swift; sourceTree = "<group>"; };
A38115B9292B447D0043E8B8 /* ShortcutCardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortcutCardCell.swift; sourceTree = "<group>"; };
A38F3B1E2AE62E8D0036FCAC /* SuggestionFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionFormView.swift; sourceTree = "<group>"; };
A39504862AD46B9B0019895E /* HapticManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HapticManager.swift; sourceTree = "<group>"; };
A3A6AD14292763E2004C49DC /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
A3A6AD1B292763E2004C49DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A3A6AD232927BA06004C49DC /* ShareExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShareExtension.entitlements; sourceTree = "<group>"; };
A3C404D52A23D0E800C3BA75 /* UpdateInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateInfoView.swift; sourceTree = "<group>"; };
A3C404D52A23D0E800C3BA75 /* AboutUpdateView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutUpdateView.swift; sourceTree = "<group>"; };
A3C5576B292BE084003907DC /* ShareExtensionWriteShortcutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareExtensionWriteShortcutView.swift; sourceTree = "<group>"; };
A3FF0182291648A300384211 /* MailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailView.swift; sourceTree = "<group>"; };
A3FF01852918552E00384211 /* AboutTeamView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutTeamView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -665,6 +671,7 @@
F976E82B29368E0D0088BBA1 /* Version.swift */,
F91F09DC29AE012600E04FA0 /* ShortcutGrade.swift */,
872B5D3C2A2E0FF9008DCC57 /* CurationType.swift */,
A323D3C92AEE870700DDA716 /* SuggestionForm.swift */,
);
path = Model;
sourceTree = "<group>";
Expand Down Expand Up @@ -692,6 +699,7 @@
F9AC2BB52935201C00165820 /* CheckUpdateVersion.swift */,
F9AFF6E22A59153B00FFFFAD /* WriteShortcutViewModel.swift */,
F92766542A61A032009C4EC2 /* WriteShortcutModalViewModel.swift */,
A323D3CB2AEEA10F00DDA716 /* SuggestionFormViewModel.swift */,
);
path = ViewModel;
sourceTree = "<group>";
Expand All @@ -708,7 +716,8 @@
isa = PBXGroup;
children = (
A34BF82C29AFC34F009BC946 /* AboutShortcutGradeView.swift */,
A3C404D52A23D0E800C3BA75 /* UpdateInfoView.swift */,
A3C404D52A23D0E800C3BA75 /* AboutUpdateView.swift */,
A38F3B1E2AE62E8D0036FCAC /* SuggestionFormView.swift */,
);
path = FeatureViews;
sourceTree = "<group>";
Expand Down Expand Up @@ -959,6 +968,7 @@
A3FF0183291648A300384211 /* MailView.swift in Sources */,
4D061BBA2A475EE800F76835 /* ExploreShortcutViewModel.swift in Sources */,
A0F822AC2910B8F100AF4448 /* ShortcutsZipViewModel.swift in Sources */,
A323D3CC2AEEA10F00DDA716 /* SuggestionFormViewModel.swift in Sources */,
87276C382933F6AB00C92F4C /* CustomTextEditor.swift in Sources */,
A34BF82D29AFC34F009BC946 /* AboutShortcutGradeView.swift in Sources */,
4D93D06F2A5956E60042CBA8 /* ShowProfileViewModel.swift in Sources */,
Expand All @@ -981,6 +991,7 @@
F9AFF6E32A59153B00FFFFAD /* WriteShortcutViewModel.swift in Sources */,
8786B2E629A7F987000B46A1 /* String+Date.swift in Sources */,
F96D45B72980301F000C2441 /* SubtitleTextView.swift in Sources */,
A323D3CA2AEE870700DDA716 /* SuggestionForm.swift in Sources */,
4DF15D752A4ECE1F0014F854 /* ListCategoryShortcutViewModel.swift in Sources */,
87E99CDB29042CCA009B691F /* Category.swift in Sources */,
876B4F6F299E3D91009672D9 /* NavigationRouter.swift in Sources */,
Expand All @@ -993,7 +1004,7 @@
87E606B829114FB200C3DA13 /* UserAuth.swift in Sources */,
8788E1A02A48408F007C3852 /* ExploreCurationViewModel.swift in Sources */,
8786B33E29ABA5A9000B46A1 /* View+Shape.swift in Sources */,
A3C404D62A23D0E800C3BA75 /* UpdateInfoView.swift in Sources */,
A3C404D62A23D0E800C3BA75 /* AboutUpdateView.swift in Sources */,
F91A72C1299915C500CA135A /* MoreCaptionTextView.swift in Sources */,
4DAD635E292AB61700ABF8C1 /* UpdateShortcutView.swift in Sources */,
87E99C9F28FFF21B009B691F /* SettingView.swift in Sources */,
Expand All @@ -1007,12 +1018,12 @@
87E99CBB28FFF298009B691F /* IconModalView.swift in Sources */,
87E99C7028F94EA6009B691F /* ShortcutTabView.swift in Sources */,
F99569182901DC4D0060AAEF /* UIFont+Extension.swift in Sources */,
A39504872AD46B9B0019895E /* HapticManager.swift in Sources */,
F91A72C32999160E00CA135A /* Alerter.swift in Sources */,
87E99CAD28FFF261009B691F /* ReadShortcutView.swift in Sources */,
4D5889E82AA36A52000C4849 /* AppDelegate.swift in Sources */,
A33F74AE2908D8C800B8D0D0 /* CheckBoxShortcutCell.swift in Sources */,
87E606B22910649B00C3DA13 /* SignInWithAppleView.swift in Sources */,
A38F3B1F2AE62E8D0036FCAC /* SuggestionFormView.swift in Sources */,
F91F09DF29AE0B5E00E04FA0 /* GradeAlertView.swift in Sources */,
4D061BB82A47531800F76835 /* ExploreShortcutView.swift in Sources */,
87E99CEC29080C30009B691F /* Curation.swift in Sources */,
Expand Down Expand Up @@ -1041,6 +1052,7 @@
8788374A2920D549009B3F54 /* Binding+Extension.swift in Sources */,
87E99CCB290145C4009B691F /* UserCurationCell.swift in Sources */,
F9724BBF292755E400860F8A /* Comment.swift in Sources */,
A323D3D02AEEE4B400DDA716 /* HapticManager.swift in Sources */,
87E99CA328FFF22E009B691F /* ExploreCurationView.swift in Sources */,
A0F822B729164D2300AF4448 /* ListCategoryShortcutView.swift in Sources */,
87B47F3B2A3DC2740009E75F /* ReadCurationViewModel.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "HeaderImage.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "easierExternalURL.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "easierShortcutWrite.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions HappyAnding/HappyAnding/Extensions/View/View+Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ extension View {
WithdrawalView()
case is CheckVersionView:
CheckVersionView()
case is NavigationUpdateInfo:
AboutUpdateView()
default:
EmptyView()
}
Expand Down Expand Up @@ -151,5 +153,8 @@ struct NavigationViewModifier: ViewModifier {
.navigationDestination(for: NavigationCheckVersion.self) { _ in
CheckVersionView()
}
.navigationDestination(for: NavigationUpdateInfo.self) { _ in
AboutUpdateView()
}
}
}
4 changes: 4 additions & 0 deletions HappyAnding/HappyAnding/Model/NavigationStackModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ enum NavigationWithdrawal: Hashable, Equatable {
enum NavigationCheckVersion: Hashable, Equatable {
case first
}

enum NavigationUpdateInfo: Hashable, Equatable {
case first
}
35 changes: 35 additions & 0 deletions HappyAnding/HappyAnding/Model/SuggestionForm.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// SuggestionForm.swift
// HappyAnding
//
// Created by HanGyeongjun on 10/29/23.
//

import Foundation

struct SuggestionForm: Identifiable, Codable, Hashable {

var id = UUID().uuidString
var userInfo: String
var dateTime = Date().getDate()
var formContent: String

var dictionary: [String: Any] {
let data = (try? JSONEncoder().encode(self)) ?? Data()
return (try? JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String: Any]) ?? [:]
}

init(userInfo: String, formContent: String) {
self.id = UUID().uuidString
self.userInfo = userInfo
self.dateTime = Date().getDate()
self.formContent = formContent
}

init() {
self.id = UUID().uuidString
self.userInfo = ""
self.dateTime = Date().getDate()
self.formContent = ""
}
}
26 changes: 22 additions & 4 deletions HappyAnding/HappyAnding/TextLiteral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum TextLiteral {
static let cancel: String = "취소"
static let next: String = "다음"
static let upload: String = "업로드"
static let confirm: String = "확인"
static let close: String = "닫기"
static let done: String = "완료"
static let edit: String = "편집"
Expand All @@ -34,10 +35,10 @@ enum TextLiteral {

//MARK: - announcementCell
static let newFeatureTag: String = "새로운 기능"
static let updateTag: String = "업데이트"
static let appUpdateTag: String = "업데이트"

//MARK: - updateCell
static let updateCellDescription: String = "업데이트된 내용 살펴보기"
static let updateCellDescription: String = "새로운 기능들 살펴보기"

//MARK: - ShortcutGrade
static let shortcutGradeTitle: String = "단축어 작성 등급"
Expand Down Expand Up @@ -83,7 +84,6 @@ enum TextLiteral {
static let nicknameTextFieldDuplicateTitle: String = "닉네임 중복 확인"
static let nicknameTextFieldDuplicateSuccessMessage: String = "사용할 수 있는 닉네임이에요"
static let nicknameTextFieldDuplicateFailMessage: String = "이미 사용 중인 닉네임이에요"
static let nicknameTextFieldDuplicateSuccessLabel: String = "확인"
static let nicknameTextFieldDuplicateFailLabel: String = "다시 입력하기"
static let nicknameTextFieldTitle: String = "닉네임 (최대 8글자)"
static let nicknameTextFieldDuplicateCheck: String = "중복확인"
Expand Down Expand Up @@ -251,9 +251,27 @@ enum TextLiteral {
static let customShareViewControllerSignInAlertMessage: String = "이 기능은 로그인 후 사용할 수 있는 기능이에요"
static let customShareViewControllerLinkVaildAlertTitle: String = "잘못된 접근이에요"
static let customShareViewControllerLinkVaildAlertMessage: String = "해당 링크는 ShortcutsZip으로 공유할 수 없어요"
static let customShareViewControllerCheck: String = "확인"

//MARK: - GradeAlertView
static let gradeAlertMessage: String = "단축어 작성 레벨이 상승했어요!"
static let gradeAlertMessageBlank: String = ""

//MARK: -UpdateInfoView
static let updateInfoViewTitle: String = "ShortcutsZip 업데이트 소식"
static let updateInfoViewVersion: String = "2023.10.23 | 1.3.3"
static let updateInfoViewTypeUpdate: String = "기능 업데이트"
static let updateInfoViewFooterTitle: String = "ShortcutsZip에게\n전하고 싶은 말이 있나요?"
static let updateInfoViewComment: String = "의견 남기러 가기"
static let featTitleFirst: String = "더욱 쉬워진 단축어 작성 과정"
static let featTitleSecond: String = "간편하게 외부 링크 살펴보기"
static let featTitleThird: String = "단축어와 댓글 작성 날짜 확인"
static let featContentFirst: String = "이제는 단축어 작성 과정에서 제목을 직접 입력하지 않아도 괜찮아요. 단축어 링크만 붙여넣으면 ShortcutsZip이 자동으로 제목을 채워준답니다. 이 기능은 단축어 앱의 공유 시트에서 바로 작성할 때도 만나볼 수 있어요."
static let featContentSecond: String = "다른 유저에게 단축어에 대해 더 자세한 정보를 알려 주고 싶을 때가 있지 않나요? 단축어 설명이나 댓글에 URL을 입력하면 ShortcutsZip이 자동으로 인식해 해당 웹사이트로 바로 이동할 수 있는 링크를 제공해요."
static let featContentThird: String = "이제 단축어를 업데이트하지 않아도 언제 업로드 된 단축어인지 알 수 있어요. 댓글에도 날짜가 표시되어서 내 단축어에 달린 최근 댓글에 빠르게 피드백 할 수 있답니다."

//MARK: -SuggestionFormView
static let SuggestionFormViewTitle: String = "ShortcutsZip에게\n전하고 싶은 말을 남겨 주세요"
static let SuggestionFormViewSubTitle: String = "기능 제안, 칭찬 등 무엇이든 작성해주세요."
static let SuggestionFormViewSuccessMessage: String = "소중한 의견을 잘 전달했어요"
static let SuggestionFormViewTextPlaceholder: String = "답변 입력하기"
}
2 changes: 2 additions & 0 deletions HappyAnding/HappyAnding/ViewModel/ShortcutsZipViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ extension ShortcutsZipViewModel {
db.collection("User").document((model as! User).id).setData((model as! User).dictionary)
case _ as Comments:
db.collection("Comment").document((model as! Comments).id).setData((model as! Comments).dictionary)
case _ as SuggestionForm:
db.collection("SuggestionForm").document((model as! SuggestionForm).id).setData((model as! SuggestionForm).dictionary)
default:
print("this is not a model.")
}
Expand Down
22 changes: 22 additions & 0 deletions HappyAnding/HappyAnding/ViewModel/SuggestionFormViewModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// SuggestionFormViewModel.swift
// HappyAnding
//
// Created by HanGyeongjun on 10/29/23.
//

import Foundation

final class SuggestionFormViewModel: ObservableObject {

private let shortcutsZipViewModel = ShortcutsZipViewModel.share

@Published var suggstionForm = SuggestionForm()

// 유저 설문을 Firebase에 업로드하는 함수
func uploadUserForm(formContent: String) {
suggstionForm.userInfo = shortcutsZipViewModel.userInfo?.nickname ?? "nil"
suggstionForm.formContent = formContent
shortcutsZipViewModel.setData(model: suggstionForm)
}
}
Loading

0 comments on commit 467f71a

Please sign in to comment.