@@ -19,78 +19,90 @@ struct ContentView: View {
1919 // MARK: - BODY
2020
2121 var body : some View {
22- VStack ( alignment: . leading, spacing: 30 ) {
22+
23+ ScrollView ( showsIndicators: false ) {
2324
24- // Default
25- Group {
26- Text ( " Default " )
27- . font ( . system( size: 14 , weight: . bold, design: . default) )
28- RespondableTextField ( text: $text1, tag: 0 , isFirstResponder: true , placeholder: " 1st " ) { value in
29- print ( " onEditing: \( value) " )
30- } didBeginEditing: {
31- print ( " didBeginEditing " )
32- } didEndEditing: {
33- print ( " didEndEditing " )
25+ VStack ( alignment: . leading, spacing: 30 ) {
26+
27+ // Default
28+ Group {
29+ Text ( " Default " )
30+ . font ( . system( size: 14 , weight: . bold, design: . default) )
31+ RespondableTextField ( text: $text1, tag: 0 , isFirstResponder: true , placeholder: " 1st " ) { value in
32+ print ( " onEditing: \( value) " )
33+ } didBeginEditing: {
34+ print ( " didBeginEditing " )
35+ } didEndEditing: {
36+ print ( " didEndEditing " )
37+ } shouldReturn: { value in
38+ print ( " shouldReturn: \( value ?? " N/A " ) " )
39+ }
40+
41+ Text ( text1)
3442 }
3543
36- Text ( text1)
37- }
38-
39- // SecureType + RectangleLine Border
40- Group {
41- Text ( " SecureType + RectangleLine Border " )
42- . font ( . system( size: 14 , weight: . bold, design: . default) )
43- RespondableTextField ( text: $text2, tag: 1 , placeholder: " 2nd " ) { value in
44- print ( " onEditing: \( value) " )
45- } didBeginEditing: {
46- print ( " didBeginEditing " )
47- } didEndEditing: {
48- print ( " didEndEditing " )
44+ // SecureType + RectangleLine Border
45+ Group {
46+ Text ( " SecureType + RectangleLine Border " )
47+ . font ( . system( size: 14 , weight: . bold, design: . default) )
48+ RespondableTextField ( text: $text2, tag: 1 , placeholder: " 2nd " ) { value in
49+ print ( " onEditing: \( value) " )
50+ } didBeginEditing: {
51+ print ( " didBeginEditing " )
52+ } didEndEditing: {
53+ print ( " didEndEditing " )
54+ } shouldReturn: { value in
55+ print ( " shouldReturn: \( value ?? " N/A " ) " )
56+ }
57+ . respondableSecureType ( )
58+ . respondableLineStyle ( )
59+
60+ Text ( text2)
4961 }
50- . respondableSecureType ( )
51- . respondableLineStyle ( )
5262
53- Text ( text2)
54- }
55-
56- // NumberPad + OneTimeCode + Rounded Border
57- Group {
58- Text ( " NumberPad + OneTimeCode + Rounded Border " )
59- . font ( . system( size: 14 , weight: . bold, design: . default) )
60- RespondableTextField ( text: $text3, tag: 2 , placeholder: " 3rd " ) { value in
61- print ( " onEditing: \( value) " )
62- } didBeginEditing: {
63- print ( " didBeginEditing " )
64- } didEndEditing: {
65- print ( " didEndEditing " )
63+ // NumberPad + OneTimeCode + Rounded Border
64+ Group {
65+ Text ( " NumberPad + OneTimeCode + Rounded Border " )
66+ . font ( . system( size: 14 , weight: . bold, design: . default) )
67+ RespondableTextField ( text: $text3, tag: 2 , placeholder: " 3rd " ) { value in
68+ print ( " onEditing: \( value) " )
69+ } didBeginEditing: {
70+ print ( " didBeginEditing " )
71+ } didEndEditing: {
72+ print ( " didEndEditing " )
73+ } shouldReturn: { value in
74+ print ( " shouldReturn: \( value ?? " N/A " ) " )
75+ }
76+ . respondableKeyboardType ( . numberPad)
77+ . respondableContentType ( . oneTimeCode)
78+ . textFieldStyle ( RoundedBorderTextFieldStyle ( ) )
79+
80+ Text ( text3)
6681 }
67- . respondableKeyboardType ( . numberPad)
68- . respondableContentType ( . oneTimeCode)
69- . textFieldStyle ( RoundedBorderTextFieldStyle ( ) )
7082
71- Text ( text3)
72- }
73-
74- // didEndEditing + Bazel Border + Font
75- Group {
76- Text ( " didBeginEditing + didEndEditing + Bazel Border " )
77- . font ( . system( size: 14 , weight: . bold, design: . default) )
78- RespondableTextField ( text: $text4, tag: 3 , placeholder: " 4th " ) { value in
79- print ( " onEditing: \( value) " )
80- } didBeginEditing: {
81- print ( " didBeginEditing " )
82- } didEndEditing: {
83- print ( " didEndEditing " )
83+ // didEndEditing + Bazel Border + Font
84+ Group {
85+ Text ( " didBeginEditing + didEndEditing + Bazel Border " )
86+ . font ( . system( size: 14 , weight: . bold, design: . default) )
87+ RespondableTextField ( text: $text4, tag: 3 , placeholder: " 4th " ) { value in
88+ print ( " onEditing: \( value) " )
89+ } didBeginEditing: {
90+ print ( " didBeginEditing " )
91+ } didEndEditing: {
92+ print ( " didEndEditing " )
93+ } shouldReturn: { value in
94+ print ( " shouldReturn: \( value ?? " N/A " ) " )
95+ }
96+ . respondableBezelStyle ( )
97+ . respondableFont ( . systemFont( ofSize: 20 , weight: . bold) )
98+
99+ Text ( text4)
84100 }
85- . respondableBezelStyle ( )
86- . respondableFont ( . systemFont( ofSize: 20 , weight: . bold) )
87101
88- Text ( text4)
89- }
90-
91- } //: V
92- . padding ( )
93-
102+ } //: V
103+ . padding ( )
104+ } //: S
105+ . preferredColorScheme ( . light)
94106 }
95107}
96108
0 commit comments