ios - UITextfield not removing the icon even after the textfield is cleared -
i have form 2 textfields , want validate type. example: have email textfield , start typing tells me whether email has been used or not. if used shows 'x' icon in textfield , if it's not shows 'check mark'. validation works fine. problem facing when try clear textfield pressing delete button(not holding down) clears textfield , shows no icon because it's empty. if try clear textfield holding down delete button, icon not disappear. here's code:
emailavailable.get(["email": newstring], handler: {(result: [basemodel]?, error: nserror?) in if let available = result as? [emailavailable] { self.emailimageview.image = available[0].available ? uiimage(named: "success") : uiimage(named: "failed") } else { self.emailimageview.image = uiimage(named: "failed") } })
i making api call here check whether email valid or not. note: validation works fine.
the above image shows check mark after textfield cleared , happens when hold down delete button. appreciated, thanks!
Comments
Post a Comment