-
Notifications
You must be signed in to change notification settings - Fork 0
7주차 과제 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
7주차 과제 #8
Changes from all commits
7e6f980
bc9211f
66bf085
a0b7dd7
4faddc5
294d191
e4d3052
949f64b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// | ||
// FooterView.swift | ||
// ATSOPT36_Assignment | ||
// | ||
// Created by 권석기 on 5/29/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct FooterView: View { | ||
var body: some View { | ||
VStack(alignment: .leading, spacing: 13) { | ||
HStack(spacing:0) { | ||
Text("공지") | ||
.foregroundStyle(.gray) | ||
Text("티빙 계정 공유 정책 추가 안내") | ||
.foregroundStyle(.gray) | ||
.fontWeight(.semibold) | ||
.padding(.leading, 8) | ||
Spacer() | ||
Image(.moveButton) | ||
} | ||
.padding(16) | ||
.background(.gray5) | ||
.cornerRadius(5) | ||
|
||
VStack(spacing: 0) { | ||
HStack { | ||
Text("고객문의") | ||
.font(.caption) | ||
.foregroundStyle(.gray) | ||
Circle() | ||
.foregroundStyle(.gray) | ||
.frame(width: 2, height: 2) | ||
Text("이용약관") | ||
.font(.caption) | ||
.foregroundStyle(.gray) | ||
Circle() | ||
.foregroundStyle(.gray) | ||
.frame(width: 2, height: 2) | ||
} | ||
|
||
HStack { | ||
Text("사업자정보") | ||
.font(.caption) | ||
.foregroundStyle(.gray) | ||
Circle() | ||
.foregroundStyle(.gray) | ||
.frame(width: 2, height: 2) | ||
Text("인재채용") | ||
.font(.caption) | ||
.foregroundStyle(.gray) | ||
} | ||
} | ||
} | ||
.padding(.top, 30) | ||
.padding(.horizontal, 15) | ||
} | ||
} | ||
|
||
#Preview { | ||
FooterView() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// HeaderView.swift | ||
// ATSOPT36_Assignment | ||
// | ||
// Created by 권석기 on 5/29/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct HeaderView: View { | ||
var body: some View { | ||
HStack { | ||
Image(.tvingLogo) | ||
Spacer() | ||
Image(.search) | ||
Image(.tvingLogo2) | ||
} | ||
.padding(.horizontal, 11) | ||
} | ||
} | ||
|
||
#Preview { | ||
HeaderView() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// KimGaHyunBestListView.swift | ||
// ATSOPT36_Assignment | ||
// | ||
// Created by 권석기 on 5/29/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct KimGaHyunBestListView: View { | ||
let items: [ContentModel] | ||
Comment on lines
+9
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ아 진짜 웃기다 ㅋㅋㅋㅋㅋ @mcrkgus There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ 아 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ |
||
var body: some View { | ||
VStack(spacing: 13) { | ||
HStack { | ||
Text("김가현PD의 인생작 TOP 5") | ||
.foregroundStyle(.white) | ||
.fontWeight(.semibold) | ||
Spacer() | ||
} | ||
.padding(.leading, 15) | ||
.padding(.vertical, 10) | ||
ScrollView(.horizontal) { | ||
HStack(alignment: .bottom, spacing: 8) { | ||
ForEach(Array(items.enumerated()), id: \.self.offset) { offset, item in | ||
Image(uiImage: item.thumbnail) | ||
.resizable() | ||
.frame(width: 160, height: 90) | ||
.cornerRadius(3) | ||
} | ||
} | ||
.padding(.leading, 15) | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
KimGaHyunBestListView(items: []) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// LivePopularListView.swift | ||
// ATSOPT36_Assignment | ||
// | ||
// Created by 권석기 on 5/29/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct LivePopularListView: View { | ||
let items: [ContentModel] | ||
var body: some View { | ||
VStack(spacing: 13) { | ||
HStack { | ||
Text("실시간 인기 LIVE") | ||
.foregroundStyle(.white) | ||
.fontWeight(.semibold) | ||
Spacer() | ||
} | ||
.padding(.leading, 15) | ||
.padding(.vertical, 10) | ||
ScrollView(.horizontal) { | ||
HStack(spacing: 8) { | ||
ForEach(Array(items.enumerated()), id: \.self.offset) { offset, item in | ||
VStack(spacing: 10) { | ||
Image(uiImage: item.thumbnail) | ||
.resizable() | ||
.frame(width: 160, height: 80) | ||
HStack(alignment: .top) { | ||
Image("number\(offset + 1)") | ||
.resizable() | ||
.aspectRatio(contentMode: .fit) | ||
.frame(width: 23) | ||
VStack(alignment: .leading) { | ||
Text(item.title) | ||
.foregroundStyle(.white) | ||
Text(item.description) | ||
.foregroundStyle(.gray) | ||
.font(.caption) | ||
Text("\(item.rating)%") | ||
.foregroundStyle(.gray) | ||
.font(.caption) | ||
} | ||
} | ||
} | ||
.frame(maxWidth: 160) | ||
Comment on lines
+25
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요런 부분은 따로 컴포넌트로 분리할 수 있어 보이는데, 하지 않으신 이유가 있는지 궁금해요!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저도 뎁스가 깊어지는 것 같아서 따로 Cell 등 ... 으로 분리하는 것도 좋아보여요 ! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이런 경우에 보통은 무조건 분리를 합니다.!! 이번에 시간이슈가 조금 있어서 |
||
} | ||
} | ||
.padding(.leading, 15) | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
LivePopularListView(items: []) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// MenuView.swift | ||
// ATSOPT36_Assignment | ||
// | ||
// Created by 권석기 on 5/29/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct MenuView: View { | ||
let items: [String] | ||
var body: some View { | ||
HStack { | ||
Spacer() | ||
ForEach(items, id: \.self) { item in | ||
Text(item) | ||
.foregroundStyle(.white) | ||
Spacer() | ||
} | ||
} | ||
.padding(.vertical, 16) | ||
} | ||
} | ||
|
||
#Preview { | ||
MenuView(items: []) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// MovieListView.swift | ||
// ATSOPT36_Assignment | ||
// | ||
// Created by 권석기 on 5/29/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct MovieListView: View { | ||
let items: [ContentModel] | ||
let title: String | ||
var isShowRanking = false | ||
|
||
var body: some View { | ||
VStack(spacing: 13) { | ||
HStack { | ||
Text(title) | ||
.foregroundStyle(.white) | ||
.fontWeight(.semibold) | ||
Spacer() | ||
} | ||
.padding(.leading, 15) | ||
.padding(.vertical, 10) | ||
ScrollView(.horizontal) { | ||
HStack(alignment: .bottom, spacing: 8) { | ||
ForEach(Array(items.enumerated()), id: \.self.offset) { offset, item in | ||
if isShowRanking { | ||
Image("number\(offset+1)") | ||
} | ||
Comment on lines
+28
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이탤릭체로 랭킹을 보여주는지 여부입니다! |
||
Image(uiImage: item.thumbnail) | ||
.resizable() | ||
.frame(width: 98, height: 146) | ||
.cornerRadius(3) | ||
} | ||
} | ||
.padding(.leading, 15) | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
MovieListView(items: [], title: "") | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// SportListView.swift | ||
// ATSOPT36_Assignment | ||
// | ||
// Created by 권석기 on 5/29/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct SportListView: View { | ||
let items: [ContentModel] | ||
var body: some View { | ||
ScrollView(.horizontal) { | ||
HStack { | ||
ForEach(items, id: \.self) { | ||
Image(uiImage: $0.thumbnail) | ||
.padding(.vertical, 6) | ||
.padding(.horizontal, 10) | ||
.background(.gray5) | ||
.cornerRadius(3) | ||
} | ||
} | ||
.padding(.leading, 15) | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
SportListView(items: []) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 이렇게 MockData를
enum
으로 관리하는 것도 좋아 보이네요! 배워갑니다