[ad_1]
I’m utilizing mixture of TextField and SecureField in my Login display screen of app, consumer can click on eye button to point out and conceal textual content utilizing this code:
ZStack(alignment: .trailing){
if isSecured{
SecureField(placeholder, textual content: $textual content)
.padding(.trailing, 35)
}else{
TextField(placeholder, textual content: $textual content)
.padding(.trailing, 35)
}
Button {
isSecured = !isSecured
} label: {
Picture(systemName: isSecured ? "eye.slash" : "eye")
}
}
.background(
Shade.grey
.body(top: 0.5)
.padding(.prime, 40)
)
So, when consumer click on eye button to point out password after which once more click on eye button after it to cover password lead SecureField to auto-clear password on getting into textual content, is there any approach in order that password does not auto-clear? thanks
[ad_2]
