How can i remove all entered text using coding?
amishabeladiya opened this issue · 1 comments
amishabeladiya commented
How can i remove all entered text using coding?
AbdelrhmanKamalEliwa commented
If you are using UIKit version, just call the clearOTP()
method.
otpTextField.clearOTP()
And if you are using the SwiftUI version, you have to set the enableClearOTP
property to True, and just set the OTP text to be empty.
AEOTPView(text: $otp, enableClearOTP: true)
Button(action: {
otp = ""
}, label: {
Text("Clear OTP")
})