File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Sources/SwiftCrossUI/Views Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,21 @@ public struct TextField: ElementaryView, View {
66 private var value : Binding < String > ?
77
88 /// Creates an editable text field with a given placeholder.
9+ public init ( _ placeholder: String = " " , text: Binding < String > ) {
10+ self . placeholder = placeholder
11+ self . value = text
12+ }
13+
14+ /// Creates an editable text field with a given placeholder.
15+ @available (
16+ * , deprecated,
17+ message: " Use TextField(_:text:) instead " ,
18+ renamed: " TextField.init(_:text:) "
19+ )
920 public init ( _ placeholder: String = " " , _ value: Binding < String > ? = nil ) {
1021 self . placeholder = placeholder
11- self . value = value
22+ var dummy = " "
23+ self . value = value ?? Binding ( get: { dummy } , set: { dummy = $0 } )
1224 }
1325
1426 public func asWidget< Backend: AppBackend > ( backend: Backend ) -> Backend . Widget {
You can’t perform that action at this time.
0 commit comments