Skip to content

Commit

Permalink
Merge pull request #37 from SOPT-all/week3-Semin
Browse files Browse the repository at this point in the history
[3주차] 이세민 실습
  • Loading branch information
sem-git authored Dec 4, 2024
2 parents 9679122 + 421074f commit 1716ff8
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 3 deletions.
16 changes: 16 additions & 0 deletions LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
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 */; };
76FC2B732D00AC0000F10EE1 /* ScrollViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B722D00AC0000F10EE1 /* ScrollViewExample.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -29,6 +31,8 @@
76DFF9312CD7B4F100C373C3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
76DFF9332CD7B4F200C373C3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
76DFF9362CD7B4F200C373C3 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
76FC2B702D00ABB600F10EE1 /* GridViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GridViewExample.swift; sourceTree = "<group>"; };
76FC2B722D00AC0000F10EE1 /* ScrollViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrollViewExample.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -85,6 +89,7 @@
76DFF92E2CD7B4F100C373C3 /* LeeSeminSU */ = {
isa = PBXGroup;
children = (
76FC2B6F2D00AB7E00F10EE1 /* Week3 */,
76FC2DD82CE06C37000B329B /* Week2 */,
76DFF92F2CD7B4F100C373C3 /* LeeSeminSUApp.swift */,
76DFF9312CD7B4F100C373C3 /* ContentView.swift */,
Expand All @@ -102,6 +107,15 @@
path = "Preview Content";
sourceTree = "<group>";
};
76FC2B6F2D00AB7E00F10EE1 /* Week3 */ = {
isa = PBXGroup;
children = (
76FC2B702D00ABB600F10EE1 /* GridViewExample.swift */,
76FC2B722D00AC0000F10EE1 /* ScrollViewExample.swift */,
);
path = Week3;
sourceTree = "<group>";
};
76FC2DD82CE06C37000B329B /* Week2 */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -192,11 +206,13 @@
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 */,
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 */,
);
Expand Down
6 changes: 3 additions & 3 deletions LeeSeminSU/LeeSeminSU/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ struct ContentView: View {

// VStackHStackExample()
// ZStackExampleView()

// ComponentExample()

// SpacerPaddingExample()
// ModifierExample()

ModifierExample()
// GridViewExample()
ScrollViewExample()
}
}

Expand Down
5 changes: 5 additions & 0 deletions LeeSeminSU/LeeSeminSU/Week2/Modifier/ModifierExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ struct ModifierExample: View {
.padding()
}
}

#Preview {
ModifierExample()
}

Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ struct SpacerPaddingExample: View {
.border(.blue)
}
}

#Preview {
SpacerPaddingExample()
}
4 changes: 4 additions & 0 deletions LeeSeminSU/LeeSeminSU/Week2/Stacks/VStackHStackExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ struct VStackHStackExample: View {

}
}

#Preview {
VStackHStackExample()
}
4 changes: 4 additions & 0 deletions LeeSeminSU/LeeSeminSU/Week2/Stacks/ZStackExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ struct ZStackExampleView: View {
}
}
}

#Preview {
ZStackExampleView()
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ struct ComponentExample: View {
}
}
}

#Preview {
ComponentExample()
}
40 changes: 40 additions & 0 deletions LeeSeminSU/LeeSeminSU/Week3/GridViewExample.swift
Original file line number Diff line number Diff line change
@@ -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()
}

52 changes: 52 additions & 0 deletions LeeSeminSU/LeeSeminSU/Week3/ScrollViewExample.swift
Original file line number Diff line number Diff line change
@@ -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()
}

0 comments on commit 1716ff8

Please sign in to comment.