Graphics Reference
In-Depth Information
[ self . repeatField resignFirstResponder ];
}
- ( IBAction )start
{
CFTimeInterval duration = [ self .durationField. text doubleValue ];
float repeatCount = [ self .repeatField. text floatValue ];
//animate the ship rotation
CABasicAnimation *animation = [ CABasicAnimation animation ];
animation. keyPath = @"transform.rotation" ;
animation. duration = duration;
animation. repeatCount = repeatCount;
animation. byValue = @( M_PI * 2) ;
animation. delegate = self ;
[ self .shipLayer addAnimation :animation forKey : @"rotateAnimation" ];
//disable controls
[ self setControlsEnabled : NO ];
}
- ( void )animationDidStop:( CAAnimation *)anim finished:( BOOL )flag
{
//reenable controls
[ self setControlsEnabled : YES ];
}
@end
Search WWH ::




Custom Search