-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from SOPT-all/week3-Semin
[3주차] 이세민 실습
- Loading branch information
Showing
9 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,8 @@ struct ModifierExample: View { | |
.padding() | ||
} | ||
} | ||
|
||
#Preview { | ||
ModifierExample() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,7 @@ struct SpacerPaddingExample: View { | |
.border(.blue) | ||
} | ||
} | ||
|
||
#Preview { | ||
SpacerPaddingExample() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,7 @@ struct VStackHStackExample: View { | |
|
||
} | ||
} | ||
|
||
#Preview { | ||
VStackHStackExample() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,7 @@ struct ZStackExampleView: View { | |
} | ||
} | ||
} | ||
|
||
#Preview { | ||
ZStackExampleView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,7 @@ struct ComponentExample: View { | |
} | ||
} | ||
} | ||
|
||
#Preview { | ||
ComponentExample() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
|