-
Notifications
You must be signed in to change notification settings - Fork 263
/
Copy pathCANEntryView.swift
59 lines (47 loc) · 1.39 KB
/
CANEntryView.swift
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
//
// CANEntryView.swift
// NFCPassportReaderApp
//
// Created by Tim Wilbrink on 23.04.21.
//
import SwiftUI
struct CANEntryView : View {
@EnvironmentObject var settings: SettingsStore
// These will be removed once DatePicker inline works correctly
@State private var editDOB = false
@State private var editDOE = false
@State private var editDateTitle : String = ""
var body : some View {
let canBinding = Binding<String>(get: {
settings.cardAccessNumber
}, set: {
settings.cardAccessNumber = $0.uppercased()
})
VStack {
TextField("CAN", text: canBinding)
.textCase(.uppercase)
.modifier(ClearButton(text: canBinding))
.textContentType(.name)
.foregroundColor(Color.primary)
.padding([.leading, .trailing])
.ignoresSafeArea(.keyboard, edges: .all)
Divider()
}
.ignoresSafeArea(.keyboard, edges: .bottom)
}
}
#if DEBUG
struct CANEntryView_Previews : PreviewProvider {
static var previews: some View {
let settings = SettingsStore()
return
Group {
NavigationView {
CANEntryView()
}
.environmentObject(settings)
.environment( \.colorScheme, .light)
}
}
}
#endif