I need to pass the focus from one TextField
to another textfield
when user clicks on continue button of keyboard. Now i want a generic textfield
which i can be used everywhere in the app so i created a reusable component
struct MyTextField: View {
@Binding var text: String
TextField("", text: $text)
.font(Font.custom(Constants.INTER_MEDIUM, size: 16))
.keyboardType(keyboardType)
.foregroundColor(Constants.GRAY_COLOR)
.submitLabel(submitLabel)
//.focused() Issue is over here , how to make it more generic
}
Now how do i pass the focused property to the TextField to make it more generic and reusable. I was looking through this answer but the issue is using the enum Field does not make it reusable across the project.