DPOTPView
DPOTPView copied to clipboard
Change Border Color and text Color instantly
I want to change borderColor and textColor instantly as soon user enters wrong OTP and then reset the colors. I have used these its not working. It works when user removes the character
otpView.borderColorTextField = app.theme.red
otpView.textColorTextField = app.theme.red
Getting same issue. Cannot assign all textfields colour at them same time. otpView.borderColorTextField =.red only sets the border colour when we focus given to any textfield on touch. Please fix it
Hi, Any update on this? Even we need to achieve the same thing..
I copy the "DPOTPView.swift" class into my project. Then add this function in that class.
public func setBorderColor(color: UIColor) {
arrTextFields.forEach {(textField) in
textField.borderStyle = .none
textField.layer.masksToBounds = false
textField.layer.shadowColor = color
textField.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
textField.layer.shadowOpacity = 1.0
textField.layer.shadowRadius = 0.0
}
}
Then use this in my swift class as.
txtOTPView.setBorderColor(color: .red)
Thanks.. I used the same thing.