-(void) viewdidload
{
[Super Viewdidload];
[Self Initbutton];
}
-(void) Initbutton
{
UIButton *button = [[UIButton alloc]init];
Button.backgroundcolor = [Uicolor Purplecolor];
Button.bounds = CGRectMake (0, 0, 100, 50);
Button.center = Self.view.center;
Button.layer.cornerRadius = 5.f;
[Button addtarget:self action: @selector (CLICKEDBTN:) forcontrolevents:uicontroleventtouchupinside];
[Self.view Addsubview:button];
Self.button = button;
}
-(void) CLICKEDBTN: (UIButton *) button
{
Popspringanimation *spring = [Popspringanimation animationwithpropertynamed:kpoplayerscalexy];
spring.velocity = [Nsvalue valuewithcgsize:cgsizemake (10.F, 10.F)];
Spring.tovalue = [Nsvalue valuewithcgsize:cgsizemake (1.F, 1.f)];
spring.springbounciness = 18.F;
[Self.button.layer pop_addanimation:spring Forkey:nil];
}
Basic use of elastic animations for IOS pop animations