Skip to content

Commit

Permalink
Merge pull request #7 from Swift-Coding-Club/feature/MainViewUI
Browse files Browse the repository at this point in the history
Feature/main view UI
  • Loading branch information
realhsb authored Feb 19, 2023
2 parents 6e651a9 + f93d15d commit 9274dd0
Show file tree
Hide file tree
Showing 21 changed files with 255 additions and 2 deletions.
18 changes: 18 additions & 0 deletions TodayPhoto/TodayPhoto.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
83AE8FDC29694517009B968E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83AE8FDB29694517009B968E /* ContentView.swift */; };
83AE8FDE29694518009B968E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83AE8FDD29694518009B968E /* Assets.xcassets */; };
83AE8FE129694518009B968E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83AE8FE029694518009B968E /* Preview Assets.xcassets */; };
83D97BEC299D1C4200D78AEA /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83D97BEB299D1C4200D78AEA /* MainView.swift */; };
83D97BEE299E500700D78AEA /* FeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83D97BED299E500700D78AEA /* FeedView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -34,6 +36,8 @@
83AE8FDB29694517009B968E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
83AE8FDD29694518009B968E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
83AE8FE029694518009B968E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
83D97BEB299D1C4200D78AEA /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
83D97BED299E500700D78AEA /* FeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -141,11 +145,21 @@
83AE8FEA29694605009B968E /* Views */ = {
isa = PBXGroup;
children = (
83D97BEA299D1C0B00D78AEA /* MainView */,
83AE8FDB29694517009B968E /* ContentView.swift */,
);
path = Views;
sourceTree = "<group>";
};
83D97BEA299D1C0B00D78AEA /* MainView */ = {
isa = PBXGroup;
children = (
83D97BEB299D1C4200D78AEA /* MainView.swift */,
83D97BED299E500700D78AEA /* FeedView.swift */,
);
path = MainView;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -224,6 +238,8 @@
8346FFFA29794F6E003847FC /* ColorExtension.swift in Sources */,
83AE8FDC29694517009B968E /* ContentView.swift in Sources */,
832A7872297C1C2A00FFD99C /* FontExtension.swift in Sources */,
83D97BEC299D1C4200D78AEA /* MainView.swift in Sources */,
83D97BEE299E500700D78AEA /* FeedView.swift in Sources */,
83AE8FDA29694517009B968E /* TodayPhotoApp.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -362,6 +378,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -392,6 +409,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "mapPinBlack.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "mapPinWhite.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "musicBlack.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "musicWhite.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "trash.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "testImg.jpg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension Color {
static let primarPurple10: Color = Color("PrimaryPurple10")

// System Color
static let ststemBlue: Color = Color("SystemBlue")
static let ststemRed: Color = Color("SystemRed")
static let systemBlue: Color = Color("SystemBlue")
static let systemRed: Color = Color("SystemRed")
}

89 changes: 89 additions & 0 deletions TodayPhoto/TodayPhoto/Source/Views/MainView/FeedView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
//
// FeedView.swift
// TodayPhoto
//
// Created by 김동윤 on 2023/02/16.
//

import SwiftUI

struct FeedView: View {

@State private var feedViewToggle = true

var body: some View {

let feedViewHeight = CGFloat(623)
let feedViewWidth = CGFloat(UIScreen.main.bounds.width - 40)

Button {
feedViewToggle.toggle()
} label: {
ZStack {
if feedViewToggle {
Image("testImg")
.resizable()
.scaledToFill()
}
VStack {
// 날짜 text
HStack {
VStack(alignment: .center) {
Text("13")
.font(Font.pretendard(size: feedViewToggle ? 80 : 60, family: .semiBold))
Text("Thursday")
.font(Font.pretendard(size: feedViewToggle ? 22 : 16, family: .regular))
}
.padding(EdgeInsets(top: 25, leading: 30, bottom: 0, trailing: 0))
.foregroundColor(feedViewToggle ? Color.white : Color.primarPurpleDark)
.shadow(radius: feedViewToggle ? 10 : 0)
.animation(.spring(), value: feedViewToggle)
Spacer()
}
if !feedViewToggle {
// 제목 text
HStack {

Text("일기 제목")
.font(Font.pretendard(size: 24, family: .bold))
.foregroundColor(Color.primarPurpleDark)
.padding(EdgeInsets(top: 20, leading: 30, bottom: 0, trailing: 0))

Spacer()
}
// 일기 본문 text
Text("하여도 기쁘며, 인간이 천자만홍이 보배를 것이다. 가치를 가슴에 때에, 청춘에서만 꽃이 힘차게 바이며, 사는가 몸이 있다. 방지하는 내려온 이상의 수 온갖 피부가 것은 있는 따뜻한 끓는다. 있는 꽃이 생생하며, 물방아 들어 피고 피가 이는 사막이다. 든 우리 뼈 봄바람이다.")
.font(Font.pretendard(size: 20, family: .medium))
.multilineTextAlignment(.leading)
.foregroundColor(Color.primaryBlackDark)
.padding(EdgeInsets(top: 1, leading: 30, bottom: 0, trailing: 30))
}
Spacer()
// 지역, 노래 label
HStack {
VStack(alignment: .leading) {
Label("서울특별시 종로구", image: "mapPin\(feedViewToggle ? "White" : "Black")")
Label("노래 - 가수", image: "music\(feedViewToggle ? "White" : "Black")")
}
.font(Font.pretendard(size: 18, family: .regular))
.foregroundColor(feedViewToggle ? Color.white : Color.primaryBlackDark)
.padding(EdgeInsets(top: 0, leading: 30, bottom: 30, trailing: 0))
Spacer()
}
}
.frame(width: feedViewWidth, height: feedViewHeight)
}
.frame(width: feedViewWidth, height: feedViewHeight)
.clipped()
.background(Color.white)
.cornerRadius(15)
.shadow(radius: 15)
}
}
}

struct FeedView_Previews: PreviewProvider {
static var previews: some View {
FeedView()
}
}
20 changes: 20 additions & 0 deletions TodayPhoto/TodayPhoto/Source/Views/MainView/MainView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// MainView.swift
// TodayPhoto
//
// Created by 김동윤 on 2023/02/15.
//

import SwiftUI

struct MainView: View {
var body: some View {
FeedView()
}
}

struct MainView_Previews: PreviewProvider {
static var previews: some View {
MainView()
}
}

0 comments on commit 9274dd0

Please sign in to comment.