Skip to content

Commit

Permalink
feat: Modifier 실습
Browse files Browse the repository at this point in the history
  • Loading branch information
sem-git committed Nov 10, 2024
1 parent 54f31ec commit ee9b573
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
12 changes: 12 additions & 0 deletions LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
769FAB262CE1157A00785E3D /* SpacerPaddingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769FAB252CE1157A00785E3D /* SpacerPaddingExample.swift */; };
769FAB292CE115B700785E3D /* ModifierExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769FAB282CE115B700785E3D /* ModifierExample.swift */; };
76BD46112CE103AB00E215FE /* VStackHStackExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76BD46102CE103AB00E215FE /* VStackHStackExample.swift */; };
76BD46132CE103C300E215FE /* ZStackExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76BD46122CE103C300E215FE /* ZStackExample.swift */; };
76BD461B2CE10C9F00E215FE /* ComponentExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76BD461A2CE10C9F00E215FE /* ComponentExample.swift */; };
Expand All @@ -19,6 +20,7 @@

/* Begin PBXFileReference section */
769FAB252CE1157A00785E3D /* SpacerPaddingExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpacerPaddingExample.swift; sourceTree = "<group>"; };
769FAB282CE115B700785E3D /* ModifierExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModifierExample.swift; sourceTree = "<group>"; };
76BD46102CE103AB00E215FE /* VStackHStackExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VStackHStackExample.swift; sourceTree = "<group>"; };
76BD46122CE103C300E215FE /* ZStackExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZStackExample.swift; sourceTree = "<group>"; };
76BD461A2CE10C9F00E215FE /* ComponentExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentExample.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -48,6 +50,14 @@
path = SpacerPadding;
sourceTree = "<group>";
};
769FAB272CE115AE00785E3D /* Modifier */ = {
isa = PBXGroup;
children = (
769FAB282CE115B700785E3D /* ModifierExample.swift */,
);
path = Modifier;
sourceTree = "<group>";
};
76BD46192CE10C8300E215FE /* UIComponent */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -95,6 +105,7 @@
76FC2DD82CE06C37000B329B /* Week2 */ = {
isa = PBXGroup;
children = (
769FAB272CE115AE00785E3D /* Modifier */,
769FAB242CE1155700785E3D /* SpacerPadding */,
76BD46192CE10C8300E215FE /* UIComponent */,
76FC2DD92CE06C4C000B329B /* Stacks */,
Expand Down Expand Up @@ -184,6 +195,7 @@
76DFF9322CD7B4F100C373C3 /* ContentView.swift in Sources */,
76DFF9302CD7B4F100C373C3 /* LeeSeminSUApp.swift in Sources */,
769FAB262CE1157A00785E3D /* SpacerPaddingExample.swift in Sources */,
769FAB292CE115B700785E3D /* ModifierExample.swift in Sources */,
76BD461B2CE10C9F00E215FE /* ComponentExample.swift in Sources */,
76BD46132CE103C300E215FE /* ZStackExample.swift in Sources */,
76BD46112CE103AB00E215FE /* VStackHStackExample.swift in Sources */,
Expand Down
Binary file not shown.
4 changes: 3 additions & 1 deletion LeeSeminSU/LeeSeminSU/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ struct ContentView: View {

// ComponentExample()

SpacerPaddingExample()
// SpacerPaddingExample()

ModifierExample()
}
}

Expand Down
46 changes: 46 additions & 0 deletions LeeSeminSU/LeeSeminSU/Week2/Modifier/ModifierExample.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// ModifierExample.swift
// LeeSeminSU
//
// Created by 이세민 on 11/10/24.
//

import SwiftUI

struct ModifierExample: View {
@State private var buttonText: String = "담곰이 좋아요 버튼"

var body: some View {
VStack(spacing: 20) {
Text("담곰이 소개서")
.font(.title2) // 폰트 크기 설정
.bold() // 텍스트를 굵게 설정
.padding()
.border(.black) // 테두리 설정

Image("vdamgome")
.resizable()
.scaledToFit() // 뷰에 맞게 크기를 조정
.frame(width: 150, height: 150) // 프레임의 너비와 높이를 제한
.shadow(color: .black.opacity(0.2), radius: 10) // 그림자 설정
.padding(20)

Text("담곰이는 귀엽습니다")
.font(.title3) // 폰트 크기 설정
.padding(20)

Button(action: {
buttonText = "감사합니다"
}) {
Text(buttonText)
.font(.title3) // 폰트 크기 설정
.padding()
.background(.blue) // 배경 색상 설정
.foregroundColor(.white) // 텍스트 색상 설정
.cornerRadius(10) // 모서리 둥글게 설정
}
.padding(20)
}
.padding()
}
}

0 comments on commit ee9b573

Please sign in to comment.