WalletView.swift
1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// WalletView.swift
// WarplySDKFrameworkIOS
//
// Created by Βασιλης Σκουρας on 20/4/22.
//
import SwiftUI
extension WalletView {
struct headerView: View {
var goBack: () -> ()
var uiscreen = UIScreen.main.bounds
var body: some View {
HStack {
Button(action: goBack) {
HStack {
Image("ic_back", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.frame(width: self.uiscreen.height * 0.022, height: self.uiscreen.height * 0.02)
.offset(y: self.uiscreen.height * 0.015)
}
}
Text("Wallet")
.frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.025, alignment: .center)
.offset( y: self.uiscreen.height * 0.02)
.font(.system(size: 15))
}
.frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.1)
}
}
}
struct WalletView: View {
var parentView: UIView
var uiscreen = UIScreen.main.bounds
func goBack(){
for subview in parentView.subviews {
if(subview.tag == 1) {
subview.removeFromSuperview()
}
}
}
var body: some View {
headerView(goBack: goBack)
Text("Wallet View")
}
}
struct WalletView_Previews: PreviewProvider {
static var previews: some View {
WalletView()
}
}