From dacb2db502d2e2d65d2b997f6201e5835c09fa1a Mon Sep 17 00:00:00 2001 From: sangwook Date: Wed, 15 Jan 2025 18:49:07 +0900 Subject: [PATCH] [chore] #25 show multiple category chips --- .../GalleryDetail/GalleryDetailFeature.swift | 2 +- .../Gallery/GalleryDetail/GalleryDetailView.swift | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/WithSuhyeon-iOS/WithSuhyeon-iOS/Presentation/Gallery/GalleryDetail/GalleryDetailFeature.swift b/WithSuhyeon-iOS/WithSuhyeon-iOS/Presentation/Gallery/GalleryDetail/GalleryDetailFeature.swift index f57c8f9..29387f1 100644 --- a/WithSuhyeon-iOS/WithSuhyeon-iOS/Presentation/Gallery/GalleryDetail/GalleryDetailFeature.swift +++ b/WithSuhyeon-iOS/WithSuhyeon-iOS/Presentation/Gallery/GalleryDetail/GalleryDetailFeature.swift @@ -19,7 +19,7 @@ class GalleryDetailFeature: Feature { var userImageURL: String = "https://reqres.in/img/faces/7-image.jpg" var title: String = "가가가가가가" var isMine: Bool = false - var category: String = "바다" + var category: [String] = ["바다", "산", "캠핑"] var nickname: String = "작심이" var date: String = "1월 25일" var count: Int = 9 diff --git a/WithSuhyeon-iOS/WithSuhyeon-iOS/Presentation/Gallery/GalleryDetail/GalleryDetailView.swift b/WithSuhyeon-iOS/WithSuhyeon-iOS/Presentation/Gallery/GalleryDetail/GalleryDetailView.swift index aaecff0..9cbfc12 100644 --- a/WithSuhyeon-iOS/WithSuhyeon-iOS/Presentation/Gallery/GalleryDetail/GalleryDetailView.swift +++ b/WithSuhyeon-iOS/WithSuhyeon-iOS/Presentation/Gallery/GalleryDetail/GalleryDetailView.swift @@ -28,12 +28,16 @@ struct GalleryDetailView : View { Image(systemName: "list.dash") } .resizable() - .scaledToFill() - .aspectRatio(1, contentMode: .fit) + .scaledToFill() + .aspectRatio(1, contentMode: .fit) - WithSuhyeonCategoryChip(title: galleryDetailFeature.state.category) - .padding(.top, 24) - .padding(.leading, 16) + HStack(spacing: 8) { + ForEach(galleryDetailFeature.state.category, id: \.self) { category in + WithSuhyeonCategoryChip(title: category) + } + } + .padding(.top, 24) + .padding(.leading, 16) Text(galleryDetailFeature.state.title) .font(.title02B)