Skip to content

Commit

Permalink
[Style] #501 - Modify code style based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
HanGyeongjun committed Oct 31, 2023
1 parent 8699340 commit 2996221
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 64 deletions.
32 changes: 16 additions & 16 deletions HappyAnding/HappyAnding.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
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 /* Form.swift in Sources */ = {isa = PBXBuildFile; fileRef = A323D3C92AEE870700DDA716 /* Form.swift */; };
A323D3CC2AEEA10F00DDA716 /* FormViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A323D3CB2AEEA10F00DDA716 /* FormViewModel.swift */; };
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 */; };
Expand All @@ -102,10 +102,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 */; };
A38F3B1F2AE62E8D0036FCAC /* ShortcutsZipFormView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A38F3B1E2AE62E8D0036FCAC /* ShortcutsZipFormView.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,8 +274,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 /* Form.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Form.swift; sourceTree = "<group>"; };
A323D3CB2AEEA10F00DDA716 /* FormViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormViewModel.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 @@ -286,12 +286,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 /* ShortcutsZipFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortcutsZipFormView.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 @@ -658,7 +658,7 @@
F976E82B29368E0D0088BBA1 /* Version.swift */,
F91F09DC29AE012600E04FA0 /* ShortcutGrade.swift */,
872B5D3C2A2E0FF9008DCC57 /* CurationType.swift */,
A323D3C92AEE870700DDA716 /* Form.swift */,
A323D3C92AEE870700DDA716 /* SuggestionForm.swift */,
);
path = Model;
sourceTree = "<group>";
Expand Down Expand Up @@ -686,7 +686,7 @@
F9AC2BB52935201C00165820 /* CheckUpdateVersion.swift */,
F9AFF6E22A59153B00FFFFAD /* WriteShortcutViewModel.swift */,
F92766542A61A032009C4EC2 /* WriteShortcutModalViewModel.swift */,
A323D3CB2AEEA10F00DDA716 /* FormViewModel.swift */,
A323D3CB2AEEA10F00DDA716 /* SuggestionFormViewModel.swift */,
);
path = ViewModel;
sourceTree = "<group>";
Expand All @@ -703,8 +703,8 @@
isa = PBXGroup;
children = (
A34BF82C29AFC34F009BC946 /* AboutShortcutGradeView.swift */,
A3C404D52A23D0E800C3BA75 /* UpdateInfoView.swift */,
A38F3B1E2AE62E8D0036FCAC /* ShortcutsZipFormView.swift */,
A3C404D52A23D0E800C3BA75 /* AboutUpdateView.swift */,
A38F3B1E2AE62E8D0036FCAC /* SuggestionFormView.swift */,
);
path = FeatureViews;
sourceTree = "<group>";
Expand Down Expand Up @@ -954,7 +954,7 @@
A3FF0183291648A300384211 /* MailView.swift in Sources */,
4D061BBA2A475EE800F76835 /* ExploreShortcutViewModel.swift in Sources */,
A0F822AC2910B8F100AF4448 /* ShortcutsZipViewModel.swift in Sources */,
A323D3CC2AEEA10F00DDA716 /* FormViewModel.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 @@ -977,7 +977,7 @@
F9AFF6E32A59153B00FFFFAD /* WriteShortcutViewModel.swift in Sources */,
8786B2E629A7F987000B46A1 /* String+Date.swift in Sources */,
F96D45B72980301F000C2441 /* SubtitleTextView.swift in Sources */,
A323D3CA2AEE870700DDA716 /* Form.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 @@ -990,7 +990,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 @@ -1008,7 +1008,7 @@
87E99CAD28FFF261009B691F /* ReadShortcutView.swift in Sources */,
A33F74AE2908D8C800B8D0D0 /* CheckBoxShortcutCell.swift in Sources */,
87E606B22910649B00C3DA13 /* SignInWithAppleView.swift in Sources */,
A38F3B1F2AE62E8D0036FCAC /* ShortcutsZipFormView.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
4 changes: 2 additions & 2 deletions HappyAnding/HappyAnding/Extensions/View/View+Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ extension View {
case is CheckVersionView:
CheckVersionView()
case is NavigationUpdateInfo:
UpdateInfoView()
AboutUpdateView()
default:
EmptyView()
}
Expand Down Expand Up @@ -154,7 +154,7 @@ struct NavigationViewModifier: ViewModifier {
CheckVersionView()
}
.navigationDestination(for: NavigationUpdateInfo.self) { _ in
UpdateInfoView()
AboutUpdateView()
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// Form.swift
// SuggestionForm.swift
// HappyAnding
//
// Created by HanGyeongjun on 10/29/23.
//

import Foundation

struct Form: Identifiable, Codable, Hashable {
struct SuggestionForm: Identifiable, Codable, Hashable {

var id = UUID().uuidString
var userInfo: String
Expand Down
10 changes: 5 additions & 5 deletions HappyAnding/HappyAnding/TextLiteral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ enum TextLiteral {
static let featContentSecond: String = "다른 유저에게 단축어에 대해 더 자세한 정보를 알려 주고 싶을 때가 있지 않나요? 단축어 설명이나 댓글에 URL을 입력하면 ShortcutsZip이 자동으로 인식해 해당 웹사이트로 바로 이동할 수 있는 링크를 제공해요."
static let featContentThird: String = "이제 단축어를 업데이트하지 않아도 언제 업로드 된 단축어인지 알 수 있어요. 댓글에도 날짜가 표시되어서 내 단축어에 달린 최근 댓글에 빠르게 피드백 할 수 있답니다."

//MARK: -ShortcutsZipFormView
static let formViewTitle: String = "ShortcutsZip에게\n전하고 싶은 말을 남겨 주세요"
static let formViewSubTitle: String = "기능 제안, 칭찬 등 무엇이든 작성해주세요"
static let formViewSuccessMessage: String = "소중한 의견을 잘 전달했어요"
static let formViewTextPlaceholder: String = "답변 입력하기"
//MARK: -SuggestionFormView
static let SuggestionFormViewTitle: String = "ShortcutsZip에게\n전하고 싶은 말을 남겨 주세요"
static let SuggestionFormViewSubTitle: String = "기능 제안, 칭찬 등 무엇이든 작성해주세요."
static let SuggestionFormViewSuccessMessage: String = "소중한 의견을 잘 전달했어요"
static let SuggestionFormViewTextPlaceholder: String = "답변 입력하기"
}
23 changes: 0 additions & 23 deletions HappyAnding/HappyAnding/ViewModel/FormViewModel.swift

This file was deleted.

4 changes: 2 additions & 2 deletions HappyAnding/HappyAnding/ViewModel/ShortcutsZipViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +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 Form:
db.collection("Form").document((model as! Form).id).setData((model as! Form).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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ struct AnnouncementCell: View {

var icon: String?
var tagName: String?
//TODO: - 태그 컬러 변경 가능하도록 수정
// var tagColor: UIColor?
var title: String
var description: String?
var isCanDismiss: Bool
var isDismissible: Bool

var body: some View {
if (isAnnouncementShow) {
Expand Down Expand Up @@ -65,7 +66,7 @@ struct AnnouncementCell: View {
}

Spacer()
if isCanDismiss {
if isDismissible {
Button {
isAnnouncementShow = false
} label: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct ExploreShortcutView: View {
icon: "updateAppIcon",
tagName: TextLiteral.appUpdateTag,
title: TextLiteral.updateCellDescription,
isCanDismiss: true)
isDismissible: true)
.navigationLinkRouter(data: NavigationUpdateInfo.first)
.id(000)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// UpdateInfoView.swift
// AboutUpdateView.swift
// HappyAnding
//
// Created by HanGyeongjun on 2023/05/29.
//

import SwiftUI

struct UpdateInfoView: View {
struct AboutUpdateView: View {
@Environment(\.loginAlertKey) var loginAlerter

@AppStorage("useWithoutSignIn") var useWithoutSignIn: Bool = false
Expand Down Expand Up @@ -67,7 +67,7 @@ struct UpdateInfoView: View {
.navigationBarTitleDisplayMode(.inline)
.background(Color.shortcutsZipBackground)
.sheet(isPresented: self.$isShowFormView) {
ShortcutsZipFormView(viewModel: FormViewModel())
SuggestionFormView(viewModel: SuggestionFormViewModel())
.presentationDetents([.large])
.presentationDragIndicator(.visible)
}
Expand Down Expand Up @@ -128,6 +128,6 @@ struct UpdateInfoView: View {

struct UpdateInfoView_Previews: PreviewProvider {
static var previews: some View {
UpdateInfoView()
AboutUpdateView()
}
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//
// ShortcutsZipFormView.swift
// SuggestionFormView.swift
// HappyAnding
//
// Created by HanGyeongjun on 10/23/23.
//

import SwiftUI

struct ShortcutsZipFormView: View {
struct SuggestionFormView: View {

enum Field: Hashable {
case text
}

@StateObject var viewModel: FormViewModel
@StateObject var viewModel: SuggestionFormViewModel

@FocusState var focusState: Bool
@State var formText: String = ""
Expand All @@ -23,10 +23,10 @@ struct ShortcutsZipFormView: View {
VStack(spacing: 0) {
ScrollView {
VStack(alignment: .leading, spacing: 24) {
Text(TextLiteral.formViewTitle)
Text(TextLiteral.SuggestionFormViewTitle)
.shortcutsZipTitle1()
.foregroundStyle(Color.gray6)
Text(TextLiteral.formViewSubTitle)
Text(TextLiteral.SuggestionFormViewSubTitle)
.shortcutsZipHeadline()
.foregroundStyle(Color.gray4)

Expand All @@ -37,7 +37,7 @@ struct ShortcutsZipFormView: View {
Image(systemName: "checkmark.circle.fill")
.largeShortcutIcon()
.foregroundStyle(Color.shortcutsZipSuccess)
Text(TextLiteral.formViewSuccessMessage)
Text(TextLiteral.SuggestionFormViewSuccessMessage)
.shortcutsZipHeadline()
.foregroundStyle(Color.gray4)
}
Expand All @@ -47,7 +47,7 @@ struct ShortcutsZipFormView: View {
Spacer()
}
} else {
TextField(TextLiteral.formViewTextPlaceholder, text: $formText, axis: .vertical)
TextField(TextLiteral.SuggestionFormViewTextPlaceholder, text: $formText, axis: .vertical)
.shortcutsZipBody1()
.padding(.horizontal, 12)
.padding(.vertical, 16)
Expand Down

0 comments on commit 2996221

Please sign in to comment.