Feel is very good one effect, go to collection.
Direct value call the following method is OK, you need to take it.
#pragma mark Jitter Animation
-(void) Shakeanimationforview: (UIView *) view
{
Gets to the current view
Calayer *viewlayer = View.layer;
Get the current View location
Cgpoint position = viewlayer.position;
Two end locations to move
Cgpoint x = cgpointmake (position.x + ten, POSITION.Y);
Cgpoint y = Cgpointmake (position.x-10, POSITION.Y);
Set animation
Cabasicanimation *animation = [cabasicanimation animationwithkeypath:@ "position"];
Set the form of motion
[Animation settimingfunction:[camediatimingfunction Functionwithname:kcamediatimingfunctiondefault];
Set Start position
[Animation Setfromvalue:[nsvalue valuewithcgpoint:x];
Set End Position
[Animation Settovalue:[nsvalue valuewithcgpoint:y];
Set auto-Invert
[Animation Setautoreverses:yes];
Set the time
[Animation setduration:.06];
Number of settings
[Animation Setrepeatcount:3];
Add on animation
[Viewlayer addanimation:animation Forkey:nil];
ios--achieve UIView jitter effect-Similar to password input error effects on Mac