What's the best way to know when a user is editing a SecureField in SwiftUI?
Our normal way of detecting this is via an .onTapGesture modifier attached to the SecureField.
However if the user is using a hardware keyboard, they don't have to tap into the field. Instead they can use arrow keys or tab to select a particular SecureField and begin editing it, in which case our .onTapGesture event does not happen.
I've been looking for an event like .onBeginEditing, or .willBeginEditing, however I don't see that there's any modifiers like this available for SecureField.
Our designers want us to change the border thickness of the field that's currently being edited so it's obvious, and of course we want to scroll that field into view if it's off-screen. How can we do stuff like this in SwiftUI with SecureField?
Thanks.
Our normal way of detecting this is via an .onTapGesture modifier attached to the SecureField.
However if the user is using a hardware keyboard, they don't have to tap into the field. Instead they can use arrow keys or tab to select a particular SecureField and begin editing it, in which case our .onTapGesture event does not happen.
I've been looking for an event like .onBeginEditing, or .willBeginEditing, however I don't see that there's any modifiers like this available for SecureField.
Our designers want us to change the border thickness of the field that's currently being edited so it's obvious, and of course we want to scroll that field into view if it's off-screen. How can we do stuff like this in SwiftUI with SecureField?
Thanks.