Make iOS & Mac UI elements 'shake'
===

I'm sure you have seen it before; when typing passwords on the mac, if you get it wrong, it shakes!

What I want to know is, is there a way of doing this with UI objects in XCode (on either iOS or Mac platforms).

Thanks!