From 404d44501a4eb138d34b786ee6fb4f9b2b5fbf20 Mon Sep 17 00:00:00 2001 From: won Date: Sun, 17 Nov 2024 17:17:20 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Add]=20Week3View=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SeungWonSU/SeungWonSU/SeungWonSUApp.swift | 2 +- SeungWonSU/SeungWonSU/week3View.swift | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 SeungWonSU/SeungWonSU/week3View.swift diff --git a/SeungWonSU/SeungWonSU/SeungWonSUApp.swift b/SeungWonSU/SeungWonSU/SeungWonSUApp.swift index 9d680da..d07cf46 100644 --- a/SeungWonSU/SeungWonSU/SeungWonSUApp.swift +++ b/SeungWonSU/SeungWonSU/SeungWonSUApp.swift @@ -11,7 +11,7 @@ import SwiftUI struct SeungWonSUApp: App { var body: some Scene { WindowGroup { - Week2View() + week3View() } } } diff --git a/SeungWonSU/SeungWonSU/week3View.swift b/SeungWonSU/SeungWonSU/week3View.swift new file mode 100644 index 0000000..b820a83 --- /dev/null +++ b/SeungWonSU/SeungWonSU/week3View.swift @@ -0,0 +1,18 @@ +// +// week3View.swift +// SeungWonSU +// +// Created by 김승원 on 11/17/24. +// + +import SwiftUI + +struct week3View: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +#Preview { + week3View() +} From 96b46b32bccf457368d260750aff4e1b24f338b5 Mon Sep 17 00:00:00 2001 From: won Date: Sun, 17 Nov 2024 18:56:40 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Feat]=203=EC=A3=BC=EC=B0=A8=20=EC=8B=A4?= =?UTF-8?q?=EC=8A=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SeungWonSU/SeungWonSU/week3View.swift | 48 ++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/SeungWonSU/SeungWonSU/week3View.swift b/SeungWonSU/SeungWonSU/week3View.swift index b820a83..c4ffe67 100644 --- a/SeungWonSU/SeungWonSU/week3View.swift +++ b/SeungWonSU/SeungWonSU/week3View.swift @@ -8,9 +8,55 @@ import SwiftUI struct week3View: View { + let data = Array(1...30).map { "Minji \($0)"} + + let columns = [ + GridItem(.flexible()), + GridItem(.flexible()), + GridItem(.flexible()) + ] + + let rows = [ + GridItem(.fixed(100)), + ] + var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + VStack(spacing: 0) { + ScrollView { + ScrollView(.horizontal) { + LazyHGrid(rows: rows, spacing: 10) { + ForEach(data, id: \.self) { i in + VStack(spacing: 0) { + Image(.minji) + .resizable() + .scaledToFit() + .cornerRadius(15) + .frame(width: 100, height: 100) + Text(i) + } + } + } + } + + + LazyVGrid(columns: columns, spacing: 10) { + ForEach(data, id: \.self) { i in + VStack(spacing: 10) { + Image(.minji) + .resizable() + .scaledToFit() + .cornerRadius(15) + Text(i) + } + } + } + .padding(.horizontal) + } + .scrollIndicators(.hidden) + } } + + } #Preview {