-1

I have an UIAlertView that I'd like to keep reshowing to the user when they are resetting their password and asked to provide a new password. I then validate the input with my own custom method, and return an error if there was one. If no error occurred, that variable will be nil. I'd like to reshow the initial UIAlertView instead of making it disappear and never come back after an error occurs. If the user presses Cancel, then it should disappear, but not with the OK button until validation is correct.

I have it working at the moment, except for the reshowing.

Anyone know how to do this?

Baby Groot
  • 4,637
  • 39
  • 52
  • 71
swiftcode
  • 3,039
  • 9
  • 39
  • 64
  • You need to reshow means what ? can you explain? – Samkit Jain Aug 20 '13 at 11:48
  • Yes. Reshowing means redisplay the `UIAlertView` to the user. As an example of what Apple does: in the App Store, if you log out of your account, and then login with wrong credentials, or just keep tapping the OK button with empty fields, it keeps that alertview up until you tap Cancel or enter in a valid login. That is what I'd like to implement. – swiftcode Aug 20 '13 at 11:52
  • Ok try using this : On click "ok" hidden alert view for some milli seconds and show again – Samkit Jain Aug 20 '13 at 11:54
  • Try implementing that UIAlertView as property. Then you can keep it constant (I mean available almost always) during runtime. – Lior Pollak Aug 20 '13 at 12:03

2 Answers2

0

For this you would need a method in the UIAlertViewDelegate and there isn't one that lets you do that. I don't think this is possible with the standard UIAlertView

0

I think you need Alertview with textfield.

See this for implementation.

Then you can give validations in UITextField delegate methods and UIAlertView delegate methods.

Community
  • 1
  • 1
Baby Groot
  • 4,637
  • 39
  • 52
  • 71