Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pote's Task #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions XcodeTips/Data/CardModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
12 changes: 8 additions & 4 deletions XcodeTips/Data/Title.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 "카드 저장하기"
}
}
}
16 changes: 8 additions & 8 deletions XcodeTips/View/AddNicknameView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions XcodeTips/View/MemojiCardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -110,6 +110,6 @@ struct MemojiCardView: View {
}

#Preview {
MemojiCardView(modl: .init(mode: .dark))
MemojiCardView(model: .init(mode: .dark))
}

4 changes: 3 additions & 1 deletion XcodeTips/View/SelectThemeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down