File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Sources/ToggleableSecureField Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,17 @@ public struct ToggleableSecureField: View {
43
43
public var body : some View {
44
44
VStack {
45
45
if isSecure {
46
- SecureField ( title, text: text)
46
+ if #available( iOS 15 . 0 , * ) {
47
+ SecureField ( title, text: text, prompt: prompt)
48
+ } else {
49
+ SecureField ( title, text: text)
50
+ }
47
51
} else {
48
- TextField ( title, text: text)
52
+ if #available( iOS 15 . 0 , * ) {
53
+ TextField ( title, text: text, prompt: prompt)
54
+ } else {
55
+ TextField ( title, text: text)
56
+ }
49
57
}
50
58
}
51
59
. textFieldStyle (
@@ -81,6 +89,9 @@ struct ToggleableSecureField_Previews: PreviewProvider {
81
89
82
90
static var previews : some View {
83
91
VStack {
92
+ Text ( " ToggleableSecureField " )
93
+ . padding ( )
94
+ . font ( . headline)
84
95
fieldGroup. colorScheme ( . light)
85
96
fieldGroup. colorScheme ( . dark)
86
97
}
You can’t perform that action at this time.
0 commit comments