Created
February 6, 2025 20:25
-
-
Save dnedrow/e010055a8c88852ccb99509c10b23a2f to your computer and use it in GitHub Desktop.
Custom init for a SwiftUI view that uses Combine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://stackoverflow.com/a/56911273 | |
| // Custom init for a SwiftUI view that uses Combine | |
| struct CustomInput : View { | |
| @Binding var text: String | |
| var name: String | |
| init(_ name: String, _ text: Binding<String>) { | |
| self.name = name | |
| self._text = text | |
| } | |
| var body: some View { | |
| TextField(name, text: $text) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment