From 0d43bb66d18fdbb0904bf8eff455b19c74032b5e Mon Sep 17 00:00:00 2001 From: sem-git Date: Sat, 7 Dec 2024 01:06:14 +0900 Subject: [PATCH 01/11] =?UTF-8?q?feat:=20=ED=95=98=EB=8B=A8=20=ED=83=AD?= =?UTF-8?q?=EB=B0=94=20UI=20=EC=B4=88=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LeeSeminSU.xcodeproj/project.pbxproj | 12 +++++ .../Assets.xcassets/Week2/Contents.json | 6 +++ .../damgome.imageset/Contents.json | 0 .../{ => Week2}/damgome.imageset/damgome.png | Bin .../vdamgome.imageset/Contents.json | 0 .../vdamgome.imageset/vdamgome.png | Bin .../Assets.xcassets/Week5/Contents.json | 6 +++ .../Week5/TabItem/Contents.json | 6 +++ .../Week5/TabItem/my.imageset/Contents.json | 12 +++++ .../Week5/TabItem/my.imageset/my.svg | 3 ++ .../Week5/TabItem/pay.imageset/Contents.json | 12 +++++ .../Week5/TabItem/pay.imageset/pay.svg | 4 ++ .../TabItem/purchase.imageset/Contents.json | 12 +++++ .../TabItem/purchase.imageset/purchase.svg | 3 ++ .../TabItem/remitment.imageset/Contents.json | 12 +++++ .../TabItem/remitment.imageset/remitment.svg | 3 ++ .../TabItem/travel.imageset/Contents.json | 12 +++++ .../Week5/TabItem/travel.imageset/travel.svg | 3 ++ LeeSeminSU/LeeSeminSU/ContentView.swift | 5 +- .../Week5 - TravelWallet/Main.swift | 50 ++++++++++++++++++ 20 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/Contents.json rename LeeSeminSU/LeeSeminSU/Assets.xcassets/{ => Week2}/damgome.imageset/Contents.json (100%) rename LeeSeminSU/LeeSeminSU/Assets.xcassets/{ => Week2}/damgome.imageset/damgome.png (100%) rename LeeSeminSU/LeeSeminSU/Assets.xcassets/{ => Week2}/vdamgome.imageset/Contents.json (100%) rename LeeSeminSU/LeeSeminSU/Assets.xcassets/{ => Week2}/vdamgome.imageset/vdamgome.png (100%) create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/my.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/my.imageset/my.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/pay.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/pay.imageset/pay.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/purchase.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/purchase.imageset/purchase.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/remitment.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/remitment.imageset/remitment.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/travel.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/travel.imageset/travel.svg create mode 100644 LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift diff --git a/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj b/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj index 88565ed..27ad8ae 100644 --- a/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj +++ b/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ 76FC2B872D00C4A100F10EE1 /* SecondNavigationViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B862D00C4A100F10EE1 /* SecondNavigationViewExample.swift */; }; 76FC2B8A2D00CA4200F10EE1 /* TabViewExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B892D00CA4200F10EE1 /* TabViewExample.swift */; }; 76FC2B8D2D00CC6600F10EE1 /* SheetModifierExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B8C2D00CC6600F10EE1 /* SheetModifierExample.swift */; }; + 76FC2B902D00D40D00F10EE1 /* Main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76FC2B8F2D00D40D00F10EE1 /* Main.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -49,6 +50,7 @@ 76FC2B862D00C4A100F10EE1 /* SecondNavigationViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondNavigationViewExample.swift; sourceTree = ""; }; 76FC2B892D00CA4200F10EE1 /* TabViewExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabViewExample.swift; sourceTree = ""; }; 76FC2B8C2D00CC6600F10EE1 /* SheetModifierExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheetModifierExample.swift; sourceTree = ""; }; + 76FC2B8F2D00D40D00F10EE1 /* Main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Main.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -105,6 +107,7 @@ 76DFF92E2CD7B4F100C373C3 /* LeeSeminSU */ = { isa = PBXGroup; children = ( + 76FC2B8E2D00D3D400F10EE1 /* Week5 - TravelWallet */, 76FC2B742D00B37D00F10EE1 /* Week4 */, 76FC2B6F2D00AB7E00F10EE1 /* Week3 */, 76FC2DD82CE06C37000B329B /* Week2 */, @@ -180,6 +183,14 @@ path = SheetModifier; sourceTree = ""; }; + 76FC2B8E2D00D3D400F10EE1 /* Week5 - TravelWallet */ = { + isa = PBXGroup; + children = ( + 76FC2B8F2D00D40D00F10EE1 /* Main.swift */, + ); + path = "Week5 - TravelWallet"; + sourceTree = ""; + }; 76FC2DD82CE06C37000B329B /* Week2 */ = { isa = PBXGroup; children = ( @@ -270,6 +281,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 76FC2B902D00D40D00F10EE1 /* Main.swift in Sources */, 76FC2B852D00C49900F10EE1 /* FirstNavigationViewExample.swift in Sources */, 76FC2B762D00B3C000F10EE1 /* StateExample.swift in Sources */, 76FC2B732D00AC0000F10EE1 /* ScrollViewExample.swift in Sources */, diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/damgome.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/damgome.imageset/Contents.json similarity index 100% rename from LeeSeminSU/LeeSeminSU/Assets.xcassets/damgome.imageset/Contents.json rename to LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/damgome.imageset/Contents.json diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/damgome.imageset/damgome.png b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/damgome.imageset/damgome.png similarity index 100% rename from LeeSeminSU/LeeSeminSU/Assets.xcassets/damgome.imageset/damgome.png rename to LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/damgome.imageset/damgome.png diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/vdamgome.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/vdamgome.imageset/Contents.json similarity index 100% rename from LeeSeminSU/LeeSeminSU/Assets.xcassets/vdamgome.imageset/Contents.json rename to LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/vdamgome.imageset/Contents.json diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/vdamgome.imageset/vdamgome.png b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/vdamgome.imageset/vdamgome.png similarity index 100% rename from LeeSeminSU/LeeSeminSU/Assets.xcassets/vdamgome.imageset/vdamgome.png rename to LeeSeminSU/LeeSeminSU/Assets.xcassets/Week2/vdamgome.imageset/vdamgome.png diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/my.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/my.imageset/Contents.json new file mode 100644 index 0000000..9b575b9 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/my.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "my.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/my.imageset/my.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/my.imageset/my.svg new file mode 100644 index 0000000..d056e3a --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/my.imageset/my.svg @@ -0,0 +1,3 @@ + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/pay.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/pay.imageset/Contents.json new file mode 100644 index 0000000..4583f30 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/pay.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "pay.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/pay.imageset/pay.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/pay.imageset/pay.svg new file mode 100644 index 0000000..9ce828b --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/pay.imageset/pay.svg @@ -0,0 +1,4 @@ + + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/purchase.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/purchase.imageset/Contents.json new file mode 100644 index 0000000..95846cc --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/purchase.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "purchase.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/purchase.imageset/purchase.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/purchase.imageset/purchase.svg new file mode 100644 index 0000000..d08e9f8 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/purchase.imageset/purchase.svg @@ -0,0 +1,3 @@ + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/remitment.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/remitment.imageset/Contents.json new file mode 100644 index 0000000..f1b2b7e --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/remitment.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "remitment.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/remitment.imageset/remitment.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/remitment.imageset/remitment.svg new file mode 100644 index 0000000..40334fb --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/remitment.imageset/remitment.svg @@ -0,0 +1,3 @@ + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/travel.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/travel.imageset/Contents.json new file mode 100644 index 0000000..512a4c5 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/travel.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "travel.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/travel.imageset/travel.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/travel.imageset/travel.svg new file mode 100644 index 0000000..f08bd96 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/TabItem/travel.imageset/travel.svg @@ -0,0 +1,3 @@ + + + diff --git a/LeeSeminSU/LeeSeminSU/ContentView.swift b/LeeSeminSU/LeeSeminSU/ContentView.swift index e117b05..3ee8e4a 100644 --- a/LeeSeminSU/LeeSeminSU/ContentView.swift +++ b/LeeSeminSU/LeeSeminSU/ContentView.swift @@ -25,7 +25,10 @@ struct ContentView: View { // BindingExample() // ObservedObjectExample() // FirstNavigationViewExample() - SheetModifierExample() +// SheetModifierExample() + +// Week5 - TravelWallet + Main() } } diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift new file mode 100644 index 0000000..b52fb83 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -0,0 +1,50 @@ +// +// Main.swift +// LeeSeminSU +// +// Created by 이세민 on 12/5/24. +// + +import SwiftUI + +struct Main: View { + var body: some View { + TabView { + Text("페이") + .tabItem { + Label("페이", image: "pay") + } + + Text("송금") + .tabItem { + Label("송금", image: "remitment") + } + .disabled(true) + + Text("직구") + .tabItem { + Label("직구", image: "purchase") + } + .disabled(true) + + Text("여행") + .tabItem { + Label("여행", image: "travel") + } + .disabled(true) + + Text("마이") + .tabItem { + Label("마이", image: "my") + } + .disabled(true) + } + .accentColor(Color(red: 0.43, green: 0.68, blue: 1)) + .padding([.leading, .trailing], 15) + } +} + + +#Preview { + Main() +} From 773f867f0cac9319f307af46fc44be7f0eb7cef5 Mon Sep 17 00:00:00 2001 From: sem-git Date: Sat, 7 Dec 2024 01:18:19 +0900 Subject: [PATCH 02/11] =?UTF-8?q?feat:=20=EC=83=81=EB=8B=A8=20=EB=84=A4?= =?UTF-8?q?=EB=B9=84=EA=B2=8C=EC=9D=B4=EC=85=98=EB=B0=94=20UI=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets.xcassets/Week5/Nav/Contents.json | 6 ++++ .../Nav/notification.imageset/Contents.json | 12 +++++++ .../notification.imageset/notification.svg | 5 +++ .../Week5/Nav/qr.imageset/Contents.json | 12 +++++++ .../Week5/Nav/qr.imageset/qr.svg | 15 +++++++++ .../Week5 - TravelWallet/Main.swift | 33 +++++++++++++++++-- 6 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/notification.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/notification.imageset/notification.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/qr.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/qr.imageset/qr.svg diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/notification.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/notification.imageset/Contents.json new file mode 100644 index 0000000..5dabea1 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/notification.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "notification.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/notification.imageset/notification.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/notification.imageset/notification.svg new file mode 100644 index 0000000..c01c33a --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/notification.imageset/notification.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/qr.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/qr.imageset/Contents.json new file mode 100644 index 0000000..d5c2776 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/qr.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "qr.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/qr.imageset/qr.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/qr.imageset/qr.svg new file mode 100644 index 0000000..5c9cc91 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/Nav/qr.imageset/qr.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift index b52fb83..fad10f8 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -10,10 +10,37 @@ import SwiftUI struct Main: View { var body: some View { TabView { - Text("페이") - .tabItem { - Label("페이", image: "pay") + VStack { + HStack { + Text("홈") + .font(.title2) + .fontWeight(.bold) + .padding(.trailing, 10) + Text("소셜페이") + .font(.title2) + .fontWeight(.bold) + .foregroundColor(Color(red: 0.74, green: 0.74, blue: 0.74)) + + Spacer() + + Image("qr") + .resizable() + .scaledToFit() + .frame(width: 20, height: 20) + .padding(.trailing, 10) + Image("notification") + .resizable() + .scaledToFit() + .frame(width: 20, height: 20) } + .padding() + + Spacer() + } + + .tabItem { + Label("페이", image: "pay") + } Text("송금") .tabItem { From 883bf5857f05612288acd6565e7a1671bb050029 Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 01:46:00 +0900 Subject: [PATCH 03/11] =?UTF-8?q?feat:=20=ED=94=8C=EB=9E=98=ED=8B=B0?= =?UTF-8?q?=EB=8A=84=20=EC=B9=B4=EB=93=9C=20=EB=B7=B0=20UI=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Week5/arrow.imageset/Contents.json | 12 +++++ .../Week5/arrow.imageset/arrow.svg | 3 ++ .../Week5/platinumCard.imageset/Contents.json | 12 +++++ .../platinumCard.imageset/platinumCard.svg | 6 +++ .../Week5 - TravelWallet/Main.swift | 52 +++++++++++++++++++ 5 files changed, 85 insertions(+) create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/arrow.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/arrow.imageset/arrow.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/platinumCard.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/platinumCard.imageset/platinumCard.svg diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/arrow.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/arrow.imageset/Contents.json new file mode 100644 index 0000000..ee30117 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/arrow.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "arrow.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/arrow.imageset/arrow.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/arrow.imageset/arrow.svg new file mode 100644 index 0000000..4e395d5 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/arrow.imageset/arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/platinumCard.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/platinumCard.imageset/Contents.json new file mode 100644 index 0000000..b279d5c --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/platinumCard.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "platinumCard.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/platinumCard.imageset/platinumCard.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/platinumCard.imageset/platinumCard.svg new file mode 100644 index 0000000..58f6048 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/platinumCard.imageset/platinumCard.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift index fad10f8..555eeb5 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -35,6 +35,43 @@ struct Main: View { } .padding() + HStack { + Image("platinumCard") + VStack(alignment: .leading, spacing: 5){ + Text("드디어 나왔다!") + .font(.system(size: 13)) + .foregroundColor(Color(hex: "#616161")) + HStack(spacing: 0) { + Text("트래블월렛 ") + .font(.system(size: 16, weight: .bold)) + .foregroundColor(Color(hex: "#000000")) + Text("플래티늄") + .font(.system(size: 16, weight: .bold)) + .foregroundColor(Color(hex: "#0079FF")) + Text(" 카드") + .font(.system(size: 16, weight: .bold)) + .foregroundColor(Color(hex: "#000000")) + } + } + Spacer() + Image("arrow") + } + .padding() + .frame(width: 343, height: 76) + .background( + RoundedRectangle(cornerRadius: 20) + .fill( + LinearGradient( + gradient: Gradient(colors: [ + Color(hex: "6FE8B7"), + Color(hex: "35DAE3") + ]), + startPoint: .leading, + endPoint: .trailing + ) + ) + ) + Spacer() } @@ -75,3 +112,18 @@ struct Main: View { #Preview { Main() } + +extension Color { + init(hex: String) { + let scanner = Scanner(string: hex) + _ = scanner.scanString("#") + + var rgb: UInt64 = 0 + scanner.scanHexInt64(&rgb) + + let r = Double((rgb >> 16) & 0xFF) / 255.0 + let g = Double((rgb >> 8) & 0xFF) / 255.0 + let b = Double((rgb >> 0) & 0xFF) / 255.0 + self.init(red: r, green: g, blue: b) + } +} From f6edcba475490429e0c2ecc6c1911869a1b2fe0c Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 02:16:29 +0900 Subject: [PATCH 04/11] =?UTF-8?q?feat:=20=EB=82=B4=20=EC=A7=80=EA=B0=91=20?= =?UTF-8?q?=EB=B7=B0=20UI=20=EC=B4=88=EA=B8=B0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Week5/info.imageset/Contents.json | 21 ++++++++ .../Week5/info.imageset/info.svg | 4 ++ .../Week5 - TravelWallet/Main.swift | 48 ++++++++++++++++++- 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/info.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/info.imageset/info.svg diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/info.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/info.imageset/Contents.json new file mode 100644 index 0000000..b5faab1 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/info.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "info.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/info.imageset/info.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/info.imageset/info.svg new file mode 100644 index 0000000..1c47cf4 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/info.imageset/info.svg @@ -0,0 +1,4 @@ + + + + diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift index 555eeb5..b43df5c 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -11,6 +11,7 @@ struct Main: View { var body: some View { TabView { VStack { + // 상단 네비게이션바 HStack { Text("홈") .font(.title2) @@ -35,6 +36,7 @@ struct Main: View { } .padding() + // 플래티늄 카드 HStack { Image("platinumCard") VStack(alignment: .leading, spacing: 5){ @@ -71,9 +73,52 @@ struct Main: View { ) ) ) + .padding(.bottom) + + // 내 지갑 + HStack{ + VStack(spacing: 45) { + HStack { + Text("내 지갑") + .font(.system(size: 18, weight: .semibold)) + Image("info") + + Spacer() + + Text("이용내역") + .font(.system(size: 15, weight: .medium)) + Image("arrow") + .padding(.leading, -13) + } + .padding(.horizontal, 5) + + Text("아직 충전된 외화가 없습니다.") + .font(.system(size: 13)) + .foregroundColor(Color(hex: "#616161")) + + Button(action: { + }) { + Text("충전하기") + .font(.system(size: 15, weight: .bold)) + .foregroundColor(.white) + .frame(width: 302, height: 48) + .background(Color(hex: "#0BAEFF")) + .cornerRadius(12) + } + } + .padding() + .frame(width: 343, height: 228) + .background( + RoundedRectangle(cornerRadius: 20) + .fill(Color(hex: "#FFFFFF")) + ) + } + Spacer() } + .background(Color(hex: "#F4F4F4")) + .tabItem { Label("페이", image: "pay") @@ -103,8 +148,7 @@ struct Main: View { } .disabled(true) } - .accentColor(Color(red: 0.43, green: 0.68, blue: 1)) - .padding([.leading, .trailing], 15) + .accentColor(Color(hex: "#0BAEFF")) } } From f978ebaa9acde99bfb445e38b9f05c7093c38270 Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 02:24:20 +0900 Subject: [PATCH 05/11] =?UTF-8?q?feat:=20=EB=8B=AC=EB=9F=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EB=B7=B0=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Week5/kakaoBank.imageset/Contents.json | 21 ++++++++++++ .../Week5/kakaoBank.imageset/kakaoBank.svg | 9 +++++ .../Week5/xmark.imageset/Contents.json | 21 ++++++++++++ .../Week5/xmark.imageset/xmark.svg | 10 ++++++ .../Week5 - TravelWallet/Main.swift | 33 +++++++++++++++++-- 5 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/kakaoBank.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/kakaoBank.imageset/kakaoBank.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/xmark.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/xmark.imageset/xmark.svg diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/kakaoBank.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/kakaoBank.imageset/Contents.json new file mode 100644 index 0000000..5cf8050 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/kakaoBank.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "kakaoBank.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/kakaoBank.imageset/kakaoBank.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/kakaoBank.imageset/kakaoBank.svg new file mode 100644 index 0000000..43cb593 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/kakaoBank.imageset/kakaoBank.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/xmark.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/xmark.imageset/Contents.json new file mode 100644 index 0000000..7a51730 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/xmark.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "xmark.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/xmark.imageset/xmark.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/xmark.imageset/xmark.svg new file mode 100644 index 0000000..e3b7674 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/xmark.imageset/xmark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift index b43df5c..d101a4b 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -61,7 +61,7 @@ struct Main: View { .padding() .frame(width: 343, height: 76) .background( - RoundedRectangle(cornerRadius: 20) + RoundedRectangle(cornerRadius: 15) .fill( LinearGradient( gradient: Gradient(colors: [ @@ -109,10 +109,39 @@ struct Main: View { .padding() .frame(width: 343, height: 228) .background( - RoundedRectangle(cornerRadius: 20) + RoundedRectangle(cornerRadius: 15) .fill(Color(hex: "#FFFFFF")) ) } + .padding(.bottom) + + // 달러박스 + HStack { + HStack(spacing: 20) { + Image("kakaoBank") + + VStack(alignment: .leading, spacing: 5) { + Text("카카오뱅크 이용중이시라면") + .font(.system(size: 10)) + Text("달러박스를 연동해보세요!") + .font(.system(size: 13, weight: .bold)) + } + } + + Spacer() + + Button(action: { + + }) { + Image("xmark") + } + } + .padding() + .frame(width: 343, height: 66) + .background( + RoundedRectangle(cornerRadius: 15) + .fill(Color(hex: "#FFFFFF")) + ) Spacer() From a21b798b86f9f7738a5cc5def26204b22efd95e9 Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 02:48:52 +0900 Subject: [PATCH 06/11] =?UTF-8?q?feat:=20=EC=88=98=ED=8F=89=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A1=A4=20=EC=B9=B4=EB=93=9C=20=EB=B7=B0=20UI=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Week5/CardItem/Contents.json | 6 ++++ .../Week5/CardItem/N.imageset/Contents.json | 12 +++++++ .../Week5/CardItem/N.imageset/N.svg | 4 +++ .../CardItem/exchange.imageset/Contents.json | 12 +++++++ .../CardItem/exchange.imageset/exchange.svg | 6 ++++ .../CardItem/remit.imageset/Contents.json | 12 +++++++ .../Week5/CardItem/remit.imageset/remit.svg | 4 +++ .../Week5 - TravelWallet/Main.swift | 34 ++++++++++++++++++- 8 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/N.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/N.imageset/N.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/exchange.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/exchange.imageset/exchange.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/remit.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/remit.imageset/remit.svg diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/N.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/N.imageset/Contents.json new file mode 100644 index 0000000..9737ed6 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/N.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "N.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/N.imageset/N.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/N.imageset/N.svg new file mode 100644 index 0000000..3767bd6 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/N.imageset/N.svg @@ -0,0 +1,4 @@ + + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/exchange.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/exchange.imageset/Contents.json new file mode 100644 index 0000000..b7cfc19 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/exchange.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "exchange.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/exchange.imageset/exchange.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/exchange.imageset/exchange.svg new file mode 100644 index 0000000..913ac8b --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/exchange.imageset/exchange.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/remit.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/remit.imageset/Contents.json new file mode 100644 index 0000000..22a2227 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/remit.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "remit.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/remit.imageset/remit.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/remit.imageset/remit.svg new file mode 100644 index 0000000..043546f --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/CardItem/remit.imageset/remit.svg @@ -0,0 +1,4 @@ + + + + diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift index d101a4b..99b781b 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -142,8 +142,17 @@ struct Main: View { RoundedRectangle(cornerRadius: 15) .fill(Color(hex: "#FFFFFF")) ) + .padding(.bottom) - + // 수평 스크롤 카드 + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 8) { + CardView(icon: "N", subtitle: "결제부터", title: "N빵하기") + CardView(icon: "remit", subtitle: "친구에게", title: "송금하기") + CardView(icon: "exchange", subtitle: "외화간", title: "환전하기") + } + .padding(.horizontal, 25) + } Spacer() } .background(Color(hex: "#F4F4F4")) @@ -181,6 +190,29 @@ struct Main: View { } } +@ViewBuilder +func CardView(icon: String, subtitle: String, title: String) -> some View { + VStack(alignment: .leading) { + Image(icon) + .padding(7) + + Spacer() + + Text(subtitle) + .font(.system(size: 15)) + .foregroundColor(Color(hex: "#616161")) + .padding(.leading, 7) + .padding(.bottom, 1) + Text(title) + .font(.system(size: 15, weight: .semibold)) + .padding(.leading, 7) + } + .padding() + .frame(width: 131, height: 131, alignment: .leading) + .background(Color(hex: "FFFFFF")) + .cornerRadius(15) +} + #Preview { Main() From 0088ff006fad4cec24e9f1aea11893103b34e4a5 Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 02:52:53 +0900 Subject: [PATCH 07/11] =?UTF-8?q?feat:=20=EB=8B=AC=EB=9F=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20X=20mark=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20?= =?UTF-8?q?=EB=B7=B0=20=EC=82=AC=EB=9D=BC=EC=A7=80=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Week5 - TravelWallet/Main.swift | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift index 99b781b..eada0de 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -8,6 +8,8 @@ import SwiftUI struct Main: View { + @State private var isDollarBoxVisible = true + var body: some View { TabView { VStack { @@ -116,33 +118,35 @@ struct Main: View { .padding(.bottom) // 달러박스 - HStack { - HStack(spacing: 20) { - Image("kakaoBank") - - VStack(alignment: .leading, spacing: 5) { - Text("카카오뱅크 이용중이시라면") - .font(.system(size: 10)) - Text("달러박스를 연동해보세요!") - .font(.system(size: 13, weight: .bold)) + if isDollarBoxVisible { + HStack { + HStack(spacing: 20) { + Image("kakaoBank") + + VStack(alignment: .leading, spacing: 5) { + Text("카카오뱅크 이용중이시라면") + .font(.system(size: 10)) + Text("달러박스를 연동해보세요!") + .font(.system(size: 13, weight: .bold)) + } } - } - - Spacer() - - Button(action: { - }) { - Image("xmark") + Spacer() + + Button(action: { + isDollarBoxVisible = false + }) { + Image("xmark") + } } + .padding() + .frame(width: 343, height: 66) + .background( + RoundedRectangle(cornerRadius: 15) + .fill(Color(hex: "#FFFFFF")) + ) + .padding(.bottom) } - .padding() - .frame(width: 343, height: 66) - .background( - RoundedRectangle(cornerRadius: 15) - .fill(Color(hex: "#FFFFFF")) - ) - .padding(.bottom) // 수평 스크롤 카드 ScrollView(.horizontal, showsIndicators: false) { From 4b2c1c61d38267de4fe83eb232d6ede1bf32a895 Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 03:11:22 +0900 Subject: [PATCH 08/11] =?UTF-8?q?feat:=20=EC=B6=A9=EC=A0=84=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C?= =?UTF-8?q?=20=EC=B6=A9=EC=A0=84=20=ED=99=94=EB=A9=B4=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=A0=84=ED=99=98=ED=95=98=EB=8F=84=EB=A1=9D=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LeeSeminSU.xcodeproj/project.pbxproj | 4 + .../Week5/KOREA.imageset/Contents.json | 12 + .../Week5/KOREA.imageset/KOREA.svg | 9 + .../Week5/USA.imageset/Contents.json | 12 + .../Week5/USA.imageset/USA.svg | 9 + .../Week5 - TravelWallet/Charge.swift | 18 ++ .../Week5 - TravelWallet/Main.swift | 266 +++++++++--------- 7 files changed, 198 insertions(+), 132 deletions(-) create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/KOREA.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/KOREA.imageset/KOREA.svg create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/USA.imageset/Contents.json create mode 100644 LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/USA.imageset/USA.svg create mode 100644 LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift diff --git a/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj b/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj index 27ad8ae..b4644ec 100644 --- a/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj +++ b/LeeSeminSU/LeeSeminSU.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 766C3A772D04C34600E2B952 /* Charge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 766C3A762D04C34600E2B952 /* Charge.swift */; }; 769FAB262CE1157A00785E3D /* SpacerPaddingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769FAB252CE1157A00785E3D /* SpacerPaddingExample.swift */; }; 769FAB292CE115B700785E3D /* ModifierExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 769FAB282CE115B700785E3D /* ModifierExample.swift */; }; 76BD46112CE103AB00E215FE /* VStackHStackExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76BD46102CE103AB00E215FE /* VStackHStackExample.swift */; }; @@ -30,6 +31,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 766C3A762D04C34600E2B952 /* Charge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Charge.swift; sourceTree = ""; }; 769FAB252CE1157A00785E3D /* SpacerPaddingExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpacerPaddingExample.swift; sourceTree = ""; }; 769FAB282CE115B700785E3D /* ModifierExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModifierExample.swift; sourceTree = ""; }; 76BD46102CE103AB00E215FE /* VStackHStackExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VStackHStackExample.swift; sourceTree = ""; }; @@ -187,6 +189,7 @@ isa = PBXGroup; children = ( 76FC2B8F2D00D40D00F10EE1 /* Main.swift */, + 766C3A762D04C34600E2B952 /* Charge.swift */, ); path = "Week5 - TravelWallet"; sourceTree = ""; @@ -287,6 +290,7 @@ 76FC2B732D00AC0000F10EE1 /* ScrollViewExample.swift in Sources */, 76DFF9322CD7B4F100C373C3 /* ContentView.swift in Sources */, 76FC2B7B2D00BA2800F10EE1 /* ObservedObjectExample.swift in Sources */, + 766C3A772D04C34600E2B952 /* Charge.swift in Sources */, 76FC2B792D00B7E300F10EE1 /* BindingExample.swift in Sources */, 76DFF9302CD7B4F100C373C3 /* LeeSeminSUApp.swift in Sources */, 769FAB262CE1157A00785E3D /* SpacerPaddingExample.swift in Sources */, diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/KOREA.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/KOREA.imageset/Contents.json new file mode 100644 index 0000000..5d0616b --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/KOREA.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "KOREA.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/KOREA.imageset/KOREA.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/KOREA.imageset/KOREA.svg new file mode 100644 index 0000000..14a9c68 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/KOREA.imageset/KOREA.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/USA.imageset/Contents.json b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/USA.imageset/Contents.json new file mode 100644 index 0000000..2e390fd --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/USA.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "USA.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/USA.imageset/USA.svg b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/USA.imageset/USA.svg new file mode 100644 index 0000000..bb72903 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Assets.xcassets/Week5/USA.imageset/USA.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift new file mode 100644 index 0000000..3430017 --- /dev/null +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift @@ -0,0 +1,18 @@ +// +// Charge.swift +// LeeSeminSU +// +// Created by 이세민 on 12/8/24. +// + +import SwiftUI + +struct Charge: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +#Preview { + Charge() +} diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift index eada0de..bfb9590 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -12,155 +12,157 @@ struct Main: View { var body: some View { TabView { - VStack { - // 상단 네비게이션바 - HStack { - Text("홈") - .font(.title2) - .fontWeight(.bold) - .padding(.trailing, 10) - Text("소셜페이") - .font(.title2) - .fontWeight(.bold) - .foregroundColor(Color(red: 0.74, green: 0.74, blue: 0.74)) - - Spacer() - - Image("qr") - .resizable() - .scaledToFit() - .frame(width: 20, height: 20) - .padding(.trailing, 10) - Image("notification") - .resizable() - .scaledToFit() - .frame(width: 20, height: 20) - } - .padding() - - // 플래티늄 카드 - HStack { - Image("platinumCard") - VStack(alignment: .leading, spacing: 5){ - Text("드디어 나왔다!") - .font(.system(size: 13)) - .foregroundColor(Color(hex: "#616161")) - HStack(spacing: 0) { - Text("트래블월렛 ") - .font(.system(size: 16, weight: .bold)) - .foregroundColor(Color(hex: "#000000")) - Text("플래티늄") - .font(.system(size: 16, weight: .bold)) - .foregroundColor(Color(hex: "#0079FF")) - Text(" 카드") - .font(.system(size: 16, weight: .bold)) - .foregroundColor(Color(hex: "#000000")) - } - } - Spacer() - Image("arrow") - } - .padding() - .frame(width: 343, height: 76) - .background( - RoundedRectangle(cornerRadius: 15) - .fill( - LinearGradient( - gradient: Gradient(colors: [ - Color(hex: "6FE8B7"), - Color(hex: "35DAE3") - ]), - startPoint: .leading, - endPoint: .trailing - ) - ) - ) - .padding(.bottom) - - // 내 지갑 - HStack{ - VStack(spacing: 45) { - HStack { - Text("내 지갑") - .font(.system(size: 18, weight: .semibold)) - Image("info") - - Spacer() - - Text("이용내역") - .font(.system(size: 15, weight: .medium)) - Image("arrow") - .padding(.leading, -13) - } - .padding(.horizontal, 5) + NavigationView { + VStack { + // 상단 네비게이션바 + HStack { + Text("홈") + .font(.title2) + .fontWeight(.bold) + .padding(.trailing, 10) + Text("소셜페이") + .font(.title2) + .fontWeight(.bold) + .foregroundColor(Color(red: 0.74, green: 0.74, blue: 0.74)) - Text("아직 충전된 외화가 없습니다.") - .font(.system(size: 13)) - .foregroundColor(Color(hex: "#616161")) + Spacer() - Button(action: { - }) { - Text("충전하기") - .font(.system(size: 15, weight: .bold)) - .foregroundColor(.white) - .frame(width: 302, height: 48) - .background(Color(hex: "#0BAEFF")) - .cornerRadius(12) - } + Image("qr") + .resizable() + .scaledToFit() + .frame(width: 20, height: 20) + .padding(.trailing, 10) + Image("notification") + .resizable() + .scaledToFit() + .frame(width: 20, height: 20) } .padding() - .frame(width: 343, height: 228) - .background( - RoundedRectangle(cornerRadius: 15) - .fill(Color(hex: "#FFFFFF")) - ) - } - .padding(.bottom) - - // 달러박스 - if isDollarBoxVisible { + + // 플래티늄 카드 HStack { - HStack(spacing: 20) { - Image("kakaoBank") - - VStack(alignment: .leading, spacing: 5) { - Text("카카오뱅크 이용중이시라면") - .font(.system(size: 10)) - Text("달러박스를 연동해보세요!") - .font(.system(size: 13, weight: .bold)) + Image("platinumCard") + VStack(alignment: .leading, spacing: 5){ + Text("드디어 나왔다!") + .font(.system(size: 13)) + .foregroundColor(Color(hex: "#616161")) + HStack(spacing: 0) { + Text("트래블월렛 ") + .font(.system(size: 16, weight: .bold)) + .foregroundColor(Color(hex: "#000000")) + Text("플래티늄") + .font(.system(size: 16, weight: .bold)) + .foregroundColor(Color(hex: "#0079FF")) + Text(" 카드") + .font(.system(size: 16, weight: .bold)) + .foregroundColor(Color(hex: "#000000")) } } - Spacer() - - Button(action: { - isDollarBoxVisible = false - }) { - Image("xmark") - } + Image("arrow") } .padding() - .frame(width: 343, height: 66) + .frame(width: 343, height: 76) .background( RoundedRectangle(cornerRadius: 15) - .fill(Color(hex: "#FFFFFF")) + .fill( + LinearGradient( + gradient: Gradient(colors: [ + Color(hex: "6FE8B7"), + Color(hex: "35DAE3") + ]), + startPoint: .leading, + endPoint: .trailing + ) + ) ) .padding(.bottom) - } - - // 수평 스크롤 카드 - ScrollView(.horizontal, showsIndicators: false) { - HStack(spacing: 8) { - CardView(icon: "N", subtitle: "결제부터", title: "N빵하기") - CardView(icon: "remit", subtitle: "친구에게", title: "송금하기") - CardView(icon: "exchange", subtitle: "외화간", title: "환전하기") + + // 내 지갑 + HStack{ + VStack(spacing: 45) { + HStack { + Text("내 지갑") + .font(.system(size: 18, weight: .semibold)) + Image("info") + + Spacer() + + Text("이용내역") + .font(.system(size: 15, weight: .medium)) + Image("arrow") + .padding(.leading, -13) + } + .padding(.horizontal, 5) + + Text("아직 충전된 외화가 없습니다.") + .font(.system(size: 13)) + .foregroundColor(Color(hex: "#616161")) + + NavigationLink(destination: Charge()) { + Text("충전하기") + .font(.system(size: 15, weight: .bold)) + .foregroundColor(.white) + .frame(width: 302, height: 48) + .background(Color(hex: "#0BAEFF")) + .cornerRadius(12) + } + } + .padding() + .frame(width: 343, height: 228) + .background( + RoundedRectangle(cornerRadius: 15) + .fill(Color(hex: "#FFFFFF")) + ) + } + .padding(.bottom) + + // 달러박스 + if isDollarBoxVisible { + HStack { + HStack(spacing: 20) { + Image("kakaoBank") + + VStack(alignment: .leading, spacing: 5) { + Text("카카오뱅크 이용중이시라면") + .font(.system(size: 10)) + Text("달러박스를 연동해보세요!") + .font(.system(size: 13, weight: .bold)) + } + } + + Spacer() + + Button(action: { + isDollarBoxVisible = false + }) { + Image("xmark") + } + } + .padding() + .frame(width: 343, height: 66) + .background( + RoundedRectangle(cornerRadius: 15) + .fill(Color(hex: "#FFFFFF")) + ) + .padding(.bottom) + } + + // 수평 스크롤 카드 + ScrollView(.horizontal, showsIndicators: false) { + HStack(spacing: 8) { + CardView(icon: "N", subtitle: "결제부터", title: "N빵하기") + CardView(icon: "remit", subtitle: "친구에게", title: "송금하기") + CardView(icon: "exchange", subtitle: "외화간", title: "환전하기") + } + .padding(.horizontal, 25) } - .padding(.horizontal, 25) + Spacer() } - Spacer() + .background(Color(hex: "#F4F4F4")) + .navigationBarHidden(true) } - .background(Color(hex: "#F4F4F4")) - + .navigationBarHidden(true) .tabItem { Label("페이", image: "pay") From 6e3c09ef5f3c33aa1819094050a7bf99b4dbe25d Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 03:30:46 +0900 Subject: [PATCH 09/11] =?UTF-8?q?feat:=20=EC=B6=A9=EC=A0=84=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Week5 - TravelWallet/Charge.swift | 48 ++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift index 3430017..2cee44b 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift @@ -9,7 +9,53 @@ import SwiftUI struct Charge: View { var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + VStack(alignment: .leading) { + HStack { + Image("USA") + Text("미국 USD") + .font(.system(size: 15, weight: .semibold)) + } + .padding(.leading) + .padding(.bottom) + .padding(.top, 70) + + TextField("충전할 금액을 입력해주세요.", text: .constant("")) + .padding(.leading) + .padding(.bottom, 40) + + HStack { + Image("KOREA") + Text("대한한국 KRW") + .font(.system(size: 15, weight: .semibold)) + } + .padding(.leading) + .padding(.bottom) + + Text("0원") + .font(.system(size: 18, weight: .semibold)) + .padding(.leading) + .padding(.bottom, 20) + + Text("1달러 = 1,400원") + .font(.system(size: 10)) + .padding(.leading) + .foregroundColor(Color(hex: "#757575")) + + Spacer() + + Button(action: { + + }) { + Text("충전하기") + .font(.system(size: 18, weight: .bold)) + .foregroundColor(.white) + .frame(maxWidth: .infinity) + .frame(height: 81) + .background(Color(hex: "#0BAEFF")) + } + + } + .navigationBarHidden(true) } } From 02ac45601293bdb5c468253cec5a3cc486218e1d Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 03:41:41 +0900 Subject: [PATCH 10/11] =?UTF-8?q?feat:=20USD=20=EC=9E=85=EB=A0=A5=ED=95=98?= =?UTF-8?q?=EB=A9=B4=20=ED=99=98=EC=9C=A8=EC=9D=84=20=EB=B0=98=EC=98=81?= =?UTF-8?q?=ED=95=9C=20KRW=EA=B0=80=20=ED=91=9C=EC=8B=9C=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LeeSeminSU/Week5 - TravelWallet/Charge.swift | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift index 2cee44b..5faf22e 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift @@ -8,6 +8,9 @@ import SwiftUI struct Charge: View { + @State private var usdMoney: String = "" + @State private var krwMoney: String = "0원" + var body: some View { VStack(alignment: .leading) { HStack { @@ -19,9 +22,18 @@ struct Charge: View { .padding(.bottom) .padding(.top, 70) - TextField("충전할 금액을 입력해주세요.", text: .constant("")) + TextField("충전할 금액을 입력해주세요.", text: $usdMoney) + .keyboardType(.decimalPad) .padding(.leading) .padding(.bottom, 40) + .onChange(of: usdMoney) { newValue in + if let usd = Double(newValue) { + let krw = usd * 1400 + krwMoney = "\(Int(krw))원" + } else { + krwMoney = "0원" + } + } HStack { Image("KOREA") @@ -31,7 +43,7 @@ struct Charge: View { .padding(.leading) .padding(.bottom) - Text("0원") + Text(krwMoney) .font(.system(size: 18, weight: .semibold)) .padding(.leading) .padding(.bottom, 20) From 2317797142cd2e39e84d559fc5ec1eccd1376dfe Mon Sep 17 00:00:00 2001 From: sem-git Date: Sun, 8 Dec 2024 19:49:03 +0900 Subject: [PATCH 11/11] =?UTF-8?q?feat:=20USD=EB=A1=9C=20=EC=B6=A9=EC=A0=84?= =?UTF-8?q?=ED=95=9C=20=EA=B8=88=EC=95=A1=20=EB=B0=94=EC=9D=B8=EB=94=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Week5 - TravelWallet/Charge.swift | 15 ++++++----- .../Week5 - TravelWallet/Main.swift | 26 +++++++++++++++---- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift index 5faf22e..e2c7e7c 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Charge.swift @@ -11,6 +11,10 @@ struct Charge: View { @State private var usdMoney: String = "" @State private var krwMoney: String = "0원" + @Binding var chargedMoney: Int + + @Environment(\.presentationMode) var presentationMode + var body: some View { VStack(alignment: .leading) { HStack { @@ -27,7 +31,7 @@ struct Charge: View { .padding(.leading) .padding(.bottom, 40) .onChange(of: usdMoney) { newValue in - if let usd = Double(newValue) { + if let usd = Int(newValue) { let krw = usd * 1400 krwMoney = "\(Int(krw))원" } else { @@ -56,7 +60,11 @@ struct Charge: View { Spacer() Button(action: { + if let usd = Int(usdMoney) { + chargedMoney += usd + } + presentationMode.wrappedValue.dismiss() }) { Text("충전하기") .font(.system(size: 18, weight: .bold)) @@ -65,12 +73,7 @@ struct Charge: View { .frame(height: 81) .background(Color(hex: "#0BAEFF")) } - } .navigationBarHidden(true) } } - -#Preview { - Charge() -} diff --git a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift index bfb9590..61e825f 100644 --- a/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift +++ b/LeeSeminSU/LeeSeminSU/Week5 - TravelWallet/Main.swift @@ -10,6 +10,8 @@ import SwiftUI struct Main: View { @State private var isDollarBoxVisible = true + @State private var chargedMoney: Int = 0 + var body: some View { TabView { NavigationView { @@ -95,11 +97,26 @@ struct Main: View { } .padding(.horizontal, 5) - Text("아직 충전된 외화가 없습니다.") - .font(.system(size: 13)) - .foregroundColor(Color(hex: "#616161")) + if chargedMoney == 0 { + Text("아직 충전된 외화가 없습니다.") + .font(.system(size: 13)) + .foregroundColor(Color(hex: "#616161")) + } + else { + HStack { + Image("USA") + Text("미국") + .font(.system(size: 15, weight: .semibold)) + + Spacer() + + Text("$\(chargedMoney)") + .font(.system(size: 15, weight: .medium)) + } + .padding(.horizontal, 5) + } - NavigationLink(destination: Charge()) { + NavigationLink(destination: Charge(chargedMoney: $chargedMoney)) { Text("충전하기") .font(.system(size: 15, weight: .bold)) .foregroundColor(.white) @@ -160,7 +177,6 @@ struct Main: View { Spacer() } .background(Color(hex: "#F4F4F4")) - .navigationBarHidden(true) } .navigationBarHidden(true)