iPhone: Save with validation on back navigation
Posted
by iPhone beginner
on Stack Overflow
See other posts from Stack Overflow
or by iPhone beginner
Published on 2009-12-15T16:10:47Z
Indexed on
2010/03/12
21:27 UTC
Read the original article
Hit count: 303
In my iPhone application I have navigation controller, main screen and some edit screens. On edit screen user does some input that has to be validated before I can save it. Ideally I would like to update data automatically on back navigation without additional "Done" button. Can I do some validation and save on back navigation (i.e. when user taps on standard back button) in a way that allows my to stop navigation and show some error message if something is wrong?
I see several other possibilities:
- Create my custom left button and make it looks like standard back. (Why Apple didn't put this button style into public API?)
- Add "Done" button and save data only if user taps it
but both these choices I like much less. So if there is a way to achieve what I want, I'd like to use it.
© Stack Overflow or respective owner