I'm using SwiftUI, but I'm coding my own custom text mask, but I need to delete when a user press the "delete" key. I'm using the onChange method, but it is not detecting when special keys are pressed. Currently I'm using:
TextField(self.placeholder, text: self.$text)
.onChange(of: self.text, perform: { value in
print(value)
})
Is there a way to detect if the delete button is pressed?
Or should I use the UITextField instead of TextField ?