On login failure, I'd prefer to avoid showing an alert, it's too fleeting. Showing the alert and then showing the text somewhere on the login screen seems like duplication.
So I'd like for it to graphically shake my login view when the user enters the wrong user ID and password like the Mac login screen does.
Anyone know if there's a way to pull this off, or have any suggestions for another effect I could use?
I know the question is already answered, but since I have already implemented something like this previously, I feel it can't hurt to add it:
Also, since you want the shaking to indicate that the user failed to log in, you might also consider adding this animation that tints the screen red while the screen shakes:
Hope this helps!
I had seen some wobble animation and changed it to shake a view t pixels upright and downleft:
A solution I used for constraints which I set in my storyboard. Without using animateWithDuration.
In my case the animation just kept on going, but I pop my viewcontroller after a duration of a few seconds, this stops my timer aswell.
Using iOS 4+ block based UIKit animations (and loosely based on on jayccrown's answer):
Here's a tutorial that details how to do it in Cocoa. Should be the same for the iPhone (or at least quite similar).
http://www.cimgf.com/2008/02/27/core-animation-tutorial-window-shake-effect/