From 2a0e752727ed5168831d3b99bf5670ade3052325 Mon Sep 17 00:00:00 2001 From: JH Date: Mon, 19 Aug 2024 02:45:27 +0900 Subject: [PATCH] Pote's Task --- XcodeTips/Data/CardModel.swift | 16 ++++++++-------- XcodeTips/Data/Title.swift | 12 ++++++++---- XcodeTips/View/AddNicknameView.swift | 16 ++++++++-------- XcodeTips/View/MemojiCardView.swift | 12 ++++++------ XcodeTips/View/SelectThemeView.swift | 4 +++- 5 files changed, 33 insertions(+), 27 deletions(-) diff --git a/XcodeTips/Data/CardModel.swift b/XcodeTips/Data/CardModel.swift index f2dfb75..177445a 100644 --- a/XcodeTips/Data/CardModel.swift +++ b/XcodeTips/Data/CardModel.swift @@ -10,15 +10,15 @@ import UIKit // 코드 정렬: ⌃(control) + i // 전체 블록 선택: ⌘(command) + a struct CardModel { -var mode: Theme - var name: String = "" -var image: UIImage = UIImage() + var mode: Theme + var name: String = "" + var image: UIImage = UIImage() -var usgImageName: String { + var usgImageName: String { return mode == .light ? "USG.logo.white" : "USG.logo.black" - } + } -var codershighImageName: String { -return mode == .light ? "codershigh.logo.white" : "codershigh.logo.black" -} + var codershighImageName: String { + return mode == .light ? "codershigh.logo.white" : "codershigh.logo.black" + } } diff --git a/XcodeTips/Data/Title.swift b/XcodeTips/Data/Title.swift index 141b041..c214480 100644 --- a/XcodeTips/Data/Title.swift +++ b/XcodeTips/Data/Title.swift @@ -16,10 +16,14 @@ enum Title { // 멀티 커서: ⌃(control) + ⇧(shift) + 원하는 위치 클릭 var value: String { switch self { - case .selectTheme: return "테마 선택하기" - case .addNickname: return "닉네임 작성하기" - case .addMemojiSticker: return "미모지 추가하기" - case .saveMemojiCard: return "카드 저장하기" + case .selectTheme: + return "테마 선택하기" + case .addNickname: + return "닉네임 작성하기" + case .addMemojiSticker: + return "미모지 추가하기" + case .saveMemojiCard: + return "카드 저장하기" } } } diff --git a/XcodeTips/View/AddNicknameView.swift b/XcodeTips/View/AddNicknameView.swift index 3c06aae..c015969 100644 --- a/XcodeTips/View/AddNicknameView.swift +++ b/XcodeTips/View/AddNicknameView.swift @@ -73,14 +73,14 @@ struct AddNicknameView: View { .padding([.horizontal], 50) .ignoresSafeArea(.keyboard) // 주석 단축키 ⌘(command) + / -// .alert( -// "닉네임을 입력해주세요.", -// isPresented: $isShowAlert -// ) { -// Button("확인") { -// isShowAlert.toggle() -// } -// } + .alert( + "닉네임을 입력해주세요.", + isPresented: $isShowAlert + ) { + Button("확인") { + isShowAlert.toggle() + } + } } } diff --git a/XcodeTips/View/MemojiCardView.swift b/XcodeTips/View/MemojiCardView.swift index 05ba8c7..ce6c4b5 100644 --- a/XcodeTips/View/MemojiCardView.swift +++ b/XcodeTips/View/MemojiCardView.swift @@ -9,18 +9,18 @@ import SwiftUI // 괄호 접기: ⌥(option) + ⌘(command) + 좌우 화살표 struct MemojiCardView: View { - var modl: CardModel + var model: CardModel @State var viewSize: CGSize = .zero var cardView: some View { - CardView(model: modl) { + CardView(model: model) { Group { - Text(modl.name) + Text(model.name) .font(.title) - .foregroundColor(modl.mode == .light ? .black : .white) + .foregroundColor(model.mode == .light ? .black : .white) .multilineTextAlignment(.center) .frame(height: 40) - Image(uiImage: modl.image) + Image(uiImage: model.image) .resizable() .scaledToFit() .aspectRatio(1, contentMode: .fit) @@ -110,6 +110,6 @@ struct MemojiCardView: View { } #Preview { - MemojiCardView(modl: .init(mode: .dark)) + MemojiCardView(model: .init(mode: .dark)) } diff --git a/XcodeTips/View/SelectThemeView.swift b/XcodeTips/View/SelectThemeView.swift index 8db0431..f425586 100644 --- a/XcodeTips/View/SelectThemeView.swift +++ b/XcodeTips/View/SelectThemeView.swift @@ -17,7 +17,9 @@ struct SelectThemeView: View { // MARK: - Life Cycles var body: some View { VStack(spacing: 20) { - Text(Title.selectTheme.value).font(.title).padding(.top) + Text(Title.selectTheme.value) + .font(.title) + .padding(.top) // 카드 CardView(model: .init(mode: mode)) {