From 9b0ad680d24a59c6f94152c23ce5d7cb4dd852e7 Mon Sep 17 00:00:00 2001 From: sem-git Date: Thu, 5 Dec 2024 00:23:36 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=EA=B0=81=20=EC=8B=A4=EC=8A=B5?= =?UTF-8?q?=EC=97=90=20Preview=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LeeSeminSU/LeeSeminSU/ContentView.swift | 3 --- LeeSeminSU/LeeSeminSU/Week2/Modifier/ModifierExample.swift | 5 +++++ .../Week2/SpacerPadding/SpacerPaddingExample.swift | 4 ++++ LeeSeminSU/LeeSeminSU/Week2/Stacks/VStackHStackExample.swift | 4 ++++ LeeSeminSU/LeeSeminSU/Week2/Stacks/ZStackExample.swift | 4 ++++ .../LeeSeminSU/Week2/UIComponent/ComponentExample.swift | 4 ++++ 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/LeeSeminSU/LeeSeminSU/ContentView.swift b/LeeSeminSU/LeeSeminSU/ContentView.swift index 85e1e0e..9b9dc36 100644 --- a/LeeSeminSU/LeeSeminSU/ContentView.swift +++ b/LeeSeminSU/LeeSeminSU/ContentView.swift @@ -12,11 +12,8 @@ struct ContentView: View { // VStackHStackExample() // ZStackExampleView() - // ComponentExample() - // SpacerPaddingExample() - ModifierExample() } } diff --git a/LeeSeminSU/LeeSeminSU/Week2/Modifier/ModifierExample.swift b/LeeSeminSU/LeeSeminSU/Week2/Modifier/ModifierExample.swift index a39f447..cc6ac99 100644 --- a/LeeSeminSU/LeeSeminSU/Week2/Modifier/ModifierExample.swift +++ b/LeeSeminSU/LeeSeminSU/Week2/Modifier/ModifierExample.swift @@ -44,3 +44,8 @@ struct ModifierExample: View { .padding() } } + +#Preview { + ModifierExample() +} + diff --git a/LeeSeminSU/LeeSeminSU/Week2/SpacerPadding/SpacerPaddingExample.swift b/LeeSeminSU/LeeSeminSU/Week2/SpacerPadding/SpacerPaddingExample.swift index 6e50534..49a0f84 100644 --- a/LeeSeminSU/LeeSeminSU/Week2/SpacerPadding/SpacerPaddingExample.swift +++ b/LeeSeminSU/LeeSeminSU/Week2/SpacerPadding/SpacerPaddingExample.swift @@ -34,3 +34,7 @@ struct SpacerPaddingExample: View { .border(.blue) } } + +#Preview { + SpacerPaddingExample() +} diff --git a/LeeSeminSU/LeeSeminSU/Week2/Stacks/VStackHStackExample.swift b/LeeSeminSU/LeeSeminSU/Week2/Stacks/VStackHStackExample.swift index 5a7d98b..0f7d4e1 100644 --- a/LeeSeminSU/LeeSeminSU/Week2/Stacks/VStackHStackExample.swift +++ b/LeeSeminSU/LeeSeminSU/Week2/Stacks/VStackHStackExample.swift @@ -31,3 +31,7 @@ struct VStackHStackExample: View { } } + +#Preview { + VStackHStackExample() +} diff --git a/LeeSeminSU/LeeSeminSU/Week2/Stacks/ZStackExample.swift b/LeeSeminSU/LeeSeminSU/Week2/Stacks/ZStackExample.swift index 680f39e..0cd9d62 100644 --- a/LeeSeminSU/LeeSeminSU/Week2/Stacks/ZStackExample.swift +++ b/LeeSeminSU/LeeSeminSU/Week2/Stacks/ZStackExample.swift @@ -28,3 +28,7 @@ struct ZStackExampleView: View { } } } + +#Preview { + ZStackExampleView() +} diff --git a/LeeSeminSU/LeeSeminSU/Week2/UIComponent/ComponentExample.swift b/LeeSeminSU/LeeSeminSU/Week2/UIComponent/ComponentExample.swift index bcde19c..2f97171 100644 --- a/LeeSeminSU/LeeSeminSU/Week2/UIComponent/ComponentExample.swift +++ b/LeeSeminSU/LeeSeminSU/Week2/UIComponent/ComponentExample.swift @@ -60,3 +60,7 @@ struct ComponentExample: View { } } } + +#Preview { + ComponentExample() +} From a73393f529941d78e3a878143adbc77638b5c6d8 Mon Sep 17 00:00:00 2001 From: sem-git Date: Thu, 5 Dec 2024 00:25:37 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20GridView=20=EC=8B=A4=EC=8A=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LeeSeminSU.xcodeproj/project.pbxproj | 12 ++++++ LeeSeminSU/LeeSeminSU/ContentView.swift | 4 +- .../LeeSeminSU/Week3/GridViewExample.swift | 40 +++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 LeeSeminSU/LeeSeminSU/Week3/GridViewExample.swift diff --git a/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj b/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj index 1fd5b3c..a3782aa 100644 --- a/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj +++ b/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 76DFF9322CD7B4F100C373C3 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76DFF9312CD7B4F100C373C3 /* ContentView.swift */; }; 76DFF9342CD7B4F200C373C3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76DFF9332CD7B4F200C373C3 /* Assets.xcassets */; }; 76DFF9372CD7B4F200C373C3 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76DFF9362CD7B4F200C373C3 /* Preview Assets.xcassets */; }; + 76FC2B712D00ABB600F10EE1 /* GridViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B702D00ABB600F10EE1 /* GridViewExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -29,6 +30,7 @@ 76DFF9312CD7B4F100C373C3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 76DFF9332CD7B4F200C373C3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 76DFF9362CD7B4F200C373C3 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 76FC2B702D00ABB600F10EE1 /* GridViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GridViewExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -85,6 +87,7 @@ 76DFF92E2CD7B4F100C373C3 /* LeeSeminSU */ = { isa = PBXGroup; children = ( + 76FC2B6F2D00AB7E00F10EE1 /* Week3 */, 76FC2DD82CE06C37000B329B /* Week2 */, 76DFF92F2CD7B4F100C373C3 /* LeeSeminSUApp.swift */, 76DFF9312CD7B4F100C373C3 /* ContentView.swift */, @@ -102,6 +105,14 @@ path = "Preview Content"; sourceTree = ""; }; + 76FC2B6F2D00AB7E00F10EE1 /* Week3 */ = { + isa = PBXGroup; + children = ( + 76FC2B702D00ABB600F10EE1 /* GridViewExample.swift */, + ); + path = Week3; + sourceTree = ""; + }; 76FC2DD82CE06C37000B329B /* Week2 */ = { isa = PBXGroup; children = ( @@ -197,6 +208,7 @@ 769FAB262CE1157A00785E3D /* SpacerPaddingExample.swift in Sources */, 769FAB292CE115B700785E3D /* ModifierExample.swift in Sources */, 76BD461B2CE10C9F00E215FE /* ComponentExample.swift in Sources */, + 76FC2B712D00ABB600F10EE1 /* GridViewExample.swift in Sources */, 76BD46132CE103C300E215FE /* ZStackExample.swift in Sources */, 76BD46112CE103AB00E215FE /* VStackHStackExample.swift in Sources */, ); diff --git a/LeeSeminSU/LeeSeminSU/ContentView.swift b/LeeSeminSU/LeeSeminSU/ContentView.swift index 9b9dc36..b9bea44 100644 --- a/LeeSeminSU/LeeSeminSU/ContentView.swift +++ b/LeeSeminSU/LeeSeminSU/ContentView.swift @@ -14,7 +14,9 @@ struct ContentView: View { // ZStackExampleView() // ComponentExample() // SpacerPaddingExample() - ModifierExample() +// ModifierExample() + + GridViewExample() } } diff --git a/LeeSeminSU/LeeSeminSU/Week3/GridViewExample.swift b/LeeSeminSU/LeeSeminSU/Week3/GridViewExample.swift new file mode 100644 index 0000000..e859214 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Week3/GridViewExample.swift @@ -0,0 +1,40 @@ +// +// GridViewExample.swift +// LeeSeminSU +// +// Created by 이세민 on 11/24/24. +// + +import SwiftUI + +struct GridViewExample: View { + var body: some View { + Grid { + GridRow { + Text("1") + Text("2") + Text("3") + } + + GridRow { + Text("4") + Text("5") + Text("6") + } + + GridRow { + Text("7") + Text("8") + Text("9") + } + } + .font(.title) + .frame(maxWidth: .infinity, maxHeight: .infinity) + .background(Color.gray.opacity(0.2)) + } +} + +#Preview { + GridViewExample() +} + From 421074ffabd6aa92dd49b9c2ade264268e0f434b Mon Sep 17 00:00:00 2001 From: sem-git Date: Thu, 5 Dec 2024 00:53:07 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20ScrollView=20=EC=8B=A4=EC=8A=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LeeSeminSU.xcodeproj/project.pbxproj | 4 ++ LeeSeminSU/LeeSeminSU/ContentView.swift | 3 +- .../LeeSeminSU/Week3/ScrollViewExample.swift | 52 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 LeeSeminSU/LeeSeminSU/Week3/ScrollViewExample.swift diff --git a/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj b/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj index a3782aa..6a0d16d 100644 --- a/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj +++ b/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 76DFF9342CD7B4F200C373C3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76DFF9332CD7B4F200C373C3 /* Assets.xcassets */; }; 76DFF9372CD7B4F200C373C3 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76DFF9362CD7B4F200C373C3 /* Preview Assets.xcassets */; }; 76FC2B712D00ABB600F10EE1 /* GridViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B702D00ABB600F10EE1 /* GridViewExample.swift */; }; + 76FC2B732D00AC0000F10EE1 /* ScrollViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B722D00AC0000F10EE1 /* ScrollViewExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -31,6 +32,7 @@ 76DFF9332CD7B4F200C373C3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 76DFF9362CD7B4F200C373C3 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 76FC2B702D00ABB600F10EE1 /* GridViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GridViewExample.swift; sourceTree = ""; }; + 76FC2B722D00AC0000F10EE1 /* ScrollViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollViewExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -109,6 +111,7 @@ isa = PBXGroup; children = ( 76FC2B702D00ABB600F10EE1 /* GridViewExample.swift */, + 76FC2B722D00AC0000F10EE1 /* ScrollViewExample.swift */, ); path = Week3; sourceTree = ""; @@ -203,6 +206,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 76FC2B732D00AC0000F10EE1 /* ScrollViewExample.swift in Sources */, 76DFF9322CD7B4F100C373C3 /* ContentView.swift in Sources */, 76DFF9302CD7B4F100C373C3 /* LeeSeminSUApp.swift in Sources */, 769FAB262CE1157A00785E3D /* SpacerPaddingExample.swift in Sources */, diff --git a/LeeSeminSU/LeeSeminSU/ContentView.swift b/LeeSeminSU/LeeSeminSU/ContentView.swift index b9bea44..56798dc 100644 --- a/LeeSeminSU/LeeSeminSU/ContentView.swift +++ b/LeeSeminSU/LeeSeminSU/ContentView.swift @@ -16,7 +16,8 @@ struct ContentView: View { // SpacerPaddingExample() // ModifierExample() - GridViewExample() +// GridViewExample() + ScrollViewExample() } } diff --git a/LeeSeminSU/LeeSeminSU/Week3/ScrollViewExample.swift b/LeeSeminSU/LeeSeminSU/Week3/ScrollViewExample.swift new file mode 100644 index 0000000..af2e951 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Week3/ScrollViewExample.swift @@ -0,0 +1,52 @@ +// +// ScrollViewExample.swift +// LeeSeminSU +// +// Created by 이세민 on 11/24/24. +// + +import SwiftUI + +struct ScrollViewExample: View { + @State private var diaryText: String = "오늘 정말 재미있는 하루였다." + + var body: some View { + ScrollView { + VStack(spacing: 25) { + Text("일기장") + .font(.largeTitle) + + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 15) { + ForEach(1...3, id: \.self) { index in + Image(systemName: "photo") + .resizable() + .scaledToFill() + .frame(width: 200, height: 200) + .background(Color.gray.opacity(0.1)) + .cornerRadius(10) + .clipped() + } + } + .padding() + } + + TextEditor(text: $diaryText) + .frame(height: 700) + .padding() + .cornerRadius(10) + .overlay( + RoundedRectangle(cornerRadius: 10) + .stroke(Color.gray, lineWidth: 0.5) + ) + .padding() + } + .padding() + } + } +} + +#Preview { + ScrollViewExample() +} +