Skip to content

Instantly share code, notes, and snippets.

@dnedrow
Created February 6, 2025 20:25
Show Gist options
  • Select an option

  • Save dnedrow/e010055a8c88852ccb99509c10b23a2f to your computer and use it in GitHub Desktop.

Select an option

Save dnedrow/e010055a8c88852ccb99509c10b23a2f to your computer and use it in GitHub Desktop.
Custom init for a SwiftUI view that uses Combine
// 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