Skip to content
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

Feature/main view feed view UI #7

Merged
merged 8 commits into from
Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VStack๊ณผ HStack... ๋ณด๋ฉด ๋ณผ์ˆ˜๋ก ์‹ ๊ธฐํ•œ ์นญ๊ตฌ๋œ

// ๋‚ ์งœ 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()
}
}