🚧 Add files
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
D49528BF2C296E8D009F6F54 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49528BE2C296E8D009F6F54 /* ContentView.swift */; };
|
||||
D49528C12C296E8F009F6F54 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D49528C02C296E8F009F6F54 /* Assets.xcassets */; };
|
||||
D49528C52C296E8F009F6F54 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D49528C42C296E8F009F6F54 /* Preview Assets.xcassets */; };
|
||||
D49528CC2C297352009F6F54 /* Booking.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49528CB2C297352009F6F54 /* Booking.swift */; };
|
||||
D49528CE2C297429009F6F54 /* Profile.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49528CD2C297429009F6F54 /* Profile.swift */; };
|
||||
D49528D12C2976BB009F6F54 /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = D49528D02C2976BB009F6F54 /* Home.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -20,6 +23,9 @@
|
||||
D49528C02C296E8F009F6F54 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
D49528C22C296E8F009F6F54 /* Wallet.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Wallet.entitlements; sourceTree = "<group>"; };
|
||||
D49528C42C296E8F009F6F54 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||
D49528CB2C297352009F6F54 /* Booking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Booking.swift; sourceTree = "<group>"; };
|
||||
D49528CD2C297429009F6F54 /* Profile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Profile.swift; sourceTree = "<group>"; };
|
||||
D49528D02C2976BB009F6F54 /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -52,6 +58,7 @@
|
||||
D49528BB2C296E8D009F6F54 /* Wallet */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D49528CF2C29761E009F6F54 /* Views */,
|
||||
D49528BC2C296E8D009F6F54 /* WalletApp.swift */,
|
||||
D49528BE2C296E8D009F6F54 /* ContentView.swift */,
|
||||
D49528C02C296E8F009F6F54 /* Assets.xcassets */,
|
||||
@@ -69,6 +76,16 @@
|
||||
path = "Preview Content";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D49528CF2C29761E009F6F54 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D49528CB2C297352009F6F54 /* Booking.swift */,
|
||||
D49528CD2C297429009F6F54 /* Profile.swift */,
|
||||
D49528D02C2976BB009F6F54 /* Home.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -140,6 +157,9 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D49528BF2C296E8D009F6F54 /* ContentView.swift in Sources */,
|
||||
D49528CE2C297429009F6F54 /* Profile.swift in Sources */,
|
||||
D49528D12C2976BB009F6F54 /* Home.swift in Sources */,
|
||||
D49528CC2C297352009F6F54 /* Booking.swift in Sources */,
|
||||
D49528BD2C296E8D009F6F54 /* WalletApp.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
@@ -1,24 +1,31 @@
|
||||
//
|
||||
// ContentView.swift
|
||||
// Wallet
|
||||
//
|
||||
// Created by Keyvan Atashfaraz on 24.06.24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image(systemName: "globe")
|
||||
.imageScale(.large)
|
||||
.foregroundStyle(.tint)
|
||||
Text("Hello, world!")
|
||||
TabView {
|
||||
HomeView()
|
||||
.tabItem {
|
||||
Image(systemName: "house.fill")
|
||||
Text("Home")
|
||||
}
|
||||
|
||||
BookingView()
|
||||
.tabItem {
|
||||
Image(systemName: "creditcard.fill")
|
||||
Text("Bookings")
|
||||
}
|
||||
|
||||
ProfileView()
|
||||
.tabItem {
|
||||
Image(systemName: "person.fill")
|
||||
Text("Profile")
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
}
|
||||
}
|
||||
|
||||
70
Wallet/Views/Booking.swift
Normal file
70
Wallet/Views/Booking.swift
Normal file
@@ -0,0 +1,70 @@
|
||||
import SwiftUI
|
||||
|
||||
public struct Booking: Identifiable {
|
||||
public let id = UUID()
|
||||
var sender_iban: String
|
||||
var receiver_iban: String
|
||||
var amount: Float
|
||||
}
|
||||
|
||||
struct BookingView: View {
|
||||
@State public var bookings: [Booking] = [
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78),
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78),
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78),
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78),
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78),
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78),
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78),
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78),
|
||||
Booking(sender_iban: "My IBAN", receiver_iban: "Another IBAN", amount: 10.76),
|
||||
Booking(sender_iban: "Another IBAN", receiver_iban: "My IBAN", amount: -3.78)
|
||||
]
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
List {
|
||||
ForEach(bookings) { booking in
|
||||
HStack {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack {
|
||||
Image(systemName: "arrow.left")
|
||||
Text(booking.sender_iban)
|
||||
}
|
||||
HStack {
|
||||
Image(systemName: "arrow.right")
|
||||
Text(booking.receiver_iban)
|
||||
}
|
||||
Text("\(booking.amount, specifier: "%.2f")")
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(5)
|
||||
.background(Color.gray.opacity(0.15))
|
||||
.cornerRadius(10)
|
||||
.padding(5)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 4)
|
||||
}
|
||||
.listRowInsets(EdgeInsets())
|
||||
.listRowSeparator(.hidden)
|
||||
}
|
||||
.listStyle(PlainListStyle())
|
||||
.navigationTitle("Bookings") // Set navigation title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct BookingsView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
BookingView()
|
||||
}
|
||||
}
|
||||
27
Wallet/Views/Home.swift
Normal file
27
Wallet/Views/Home.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
import SwiftUI
|
||||
|
||||
struct HomeView: View {
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
VStack {
|
||||
Text("Hello, World!")
|
||||
.padding()
|
||||
NavigationLink(destination: SecondView()) {
|
||||
Text("Go to Second View")
|
||||
.foregroundColor(.blue)
|
||||
.padding()
|
||||
.background(Color.gray.opacity(0.2))
|
||||
.cornerRadius(8)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Home")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct SecondView: View {
|
||||
var body: some View {
|
||||
Text("This is the second view")
|
||||
.navigationTitle("Second View")
|
||||
}
|
||||
}
|
||||
16
Wallet/Views/Profile.swift
Normal file
16
Wallet/Views/Profile.swift
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Profile.swift
|
||||
// Wallet
|
||||
//
|
||||
// Created by Keyvan Atashfaraz on 24.06.24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ProfileView: View {
|
||||
var body: some View {
|
||||
Text("Profile View")
|
||||
.navigationTitle("Profile")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user