Skip to content

Commit

Permalink
Merge pull request #26 from jayden000106/Detail/UI
Browse files Browse the repository at this point in the history
[FEAT] #2 컨텐츠 세부화면 UI 구성
  • Loading branch information
commitcomplete committed Jul 12, 2022
2 parents 3e73af3 + e3bc91d commit 455e2a3
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 3 deletions.
34 changes: 31 additions & 3 deletions NeflixCloneCoding/NeflixCloneCoding.xcodeproj/project.pbxproj
Expand Up @@ -11,9 +11,14 @@
78268A9C287016BB0099F75C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78268A9B287016BB0099F75C /* ContentView.swift */; };
78268A9E287016BC0099F75C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 78268A9D287016BC0099F75C /* Assets.xcassets */; };
78268AA1287016BC0099F75C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 78268AA0287016BC0099F75C /* Preview Assets.xcassets */; };
78268AA8287016D90099F75C /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78268AA7287016D90099F75C /* Storage.swift */; };

B929282C28791CFF00443708 /* Storage.swift in Sources */ = {isa = PBXBuildFile; fileRef = B929282B28791CFF00443708 /* Storage.swift */; };
B973729E2879201A004C83DE /* ContentDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B973729D2879201A004C83DE /* ContentDetailView.swift */; };


78AF389F2877033E00BA81D4 /* NetflixMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78AF389E2877033E00BA81D4 /* NetflixMain.swift */; };
78AF38A328770BE700BA81D4 /* TopContent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78AF38A228770BE700BA81D4 /* TopContent.swift */; };

/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -22,9 +27,14 @@
78268A9B287016BB0099F75C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
78268A9D287016BC0099F75C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
78268AA0287016BC0099F75C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };


B973729D2879201A004C83DE /* ContentDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentDetailView.swift; sourceTree = "<group>"; };

78268AA7287016D90099F75C /* Storage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storage.swift; sourceTree = "<group>"; };
78AF389E2877033E00BA81D4 /* NetflixMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetflixMain.swift; sourceTree = "<group>"; };
78AF38A228770BE700BA81D4 /* TopContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopContent.swift; sourceTree = "<group>"; };

/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -57,12 +67,16 @@
78268A98287016BB0099F75C /* NeflixCloneCoding */ = {
isa = PBXGroup;
children = (

B973729C28791FAE004C83DE /* Detail */,

7862CCDB2875B0DA00FE3545 /* Main */,

78268A99287016BB0099F75C /* NeflixCloneCodingApp.swift */,
78268A9B287016BB0099F75C /* ContentView.swift */,
78268A9D287016BC0099F75C /* Assets.xcassets */,
78268A9F287016BC0099F75C /* Preview Content */,
78268AA7287016D90099F75C /* Storage.swift */,
B929282B28791CFF00443708 /* Storage.swift */,
);
path = NeflixCloneCoding;
sourceTree = "<group>";
Expand All @@ -75,13 +89,22 @@
path = "Preview Content";
sourceTree = "<group>";
};

B973729C28791FAE004C83DE /* Detail */ = {
isa = PBXGroup;
children = (
B973729D2879201A004C83DE /* ContentDetailView.swift */,
);
path = Detail;

7862CCDB2875B0DA00FE3545 /* Main */ = {
isa = PBXGroup;
children = (
78AF389E2877033E00BA81D4 /* NetflixMain.swift */,
78AF38A228770BE700BA81D4 /* TopContent.swift */,
);
path = Main;

sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -155,10 +178,15 @@
buildActionMask = 2147483647;
files = (
78268A9C287016BB0099F75C /* ContentView.swift in Sources */,
B929282C28791CFF00443708 /* Storage.swift in Sources */,
78268A9A287016BB0099F75C /* NeflixCloneCodingApp.swift in Sources */,

B973729E2879201A004C83DE /* ContentDetailView.swift in Sources */,

78AF38A328770BE700BA81D4 /* TopContent.swift in Sources */,
78268AA8287016D90099F75C /* Storage.swift in Sources */,

78AF389F2877033E00BA81D4 /* NetflixMain.swift in Sources */,

);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
105 changes: 105 additions & 0 deletions NeflixCloneCoding/NeflixCloneCoding/Detail/ContentDetailView.swift
@@ -0,0 +1,105 @@
//
// ContentDetailView.swift
// NeflixCloneCoding
//
// Created by 정지혁 on 2022/07/09.
//

import SwiftUI

struct ContentDetailView: View {
var columns: [GridItem] = Array(repeating: .init(.flexible(), spacing: 7), count: 3)

var body: some View {
ZStack {
Color.black
.ignoresSafeArea()

ScrollView {
VStack(alignment: .leading, spacing: 0) {
TopRoundedRectangle(radius: 13, height: 220)

Text("이상한 나라의 수학자")
.font(.system(size: 16))
.padding(.horizontal, 8)
.padding(.vertical, 10)

Text("학업과 재정 측면에서 어려움을 겪고 있는 학생. 학교 경비원에게 수학을 가르쳐 달라고 요청한다. 그리고 성적보다 훨씬 더 많은 것을 얻게 되는데.")
.font(.system(size: 12))
.padding(.horizontal, 8)

HStack(spacing: 0) {
Text("출연: ")
.font(.system(size: 10))

Text("최민식, 김동회, 박병은 ...")
.font(.system(size: 10))

Button(action: {}, label: {
Text("더보기")
.font(.system(size: 10))
.fontWeight(.semibold)
.foregroundColor(.secondary)
})
}
.padding(.horizontal, 8)
.padding(.top, 10)

HStack(spacing: 0) {
Text("감독: ")
.font(.system(size: 10))

Text("박동훈")
.font(.system(size: 10))
}
.padding(.horizontal, 8)
.padding(.top, 4)

VStack(alignment: .leading, spacing: 0) {
Rectangle()
.fill(.red)
.frame(maxWidth: 97, maxHeight: 4)

Text("함께 시청된 컨텐츠")
.font(.system(size: 13, weight: .semibold))
.padding(.top, 10)
}
.padding(.horizontal, 12)
.padding(.top, 10)

LazyVGrid(columns: columns, spacing: 7) {
ForEach((0...5), id: \.self) { _ in
RoundedRectangle(cornerRadius: 4)
.frame(height: 174)
}
}
.padding(.horizontal, 8)
.padding(.top, 16)
}
}
}
.preferredColorScheme(.dark)
}
}

struct ContentDetailView_Previews: PreviewProvider {
static var previews: some View {
ContentDetailView()
.previewDevice("iPhone 13 Pro")
}
}

// 상단 모서리만 둥근 모서리로 만드는 코드
// https://stackoverflow.com/questions/56760335/round-specific-corners-swiftui
struct TopRoundedRectangle: View {
var radius: CGFloat;
var height: CGFloat;
var body: some View {
Rectangle()
.frame(height: height)
.foregroundColor(.orange)
.padding(.bottom, radius)
.cornerRadius(radius)
.padding(.bottom, -radius)
}
}

0 comments on commit 455e2a3

Please sign in to comment.