I have made a custom activity indicator to use in a project. I rotate a static loader image for that.
- (void) rotate {
lastInstance++;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(rotate)];
[UIView setAnimationDuration:0.1];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
spinnerImageView.layer.transform = CATransform3DMakeRotation(M_PI*(lastInstance%10)/5, 0.0, 0.0, 1.0);
[UIView commitAnimations];
}
The spinnerimageview
is contained within a superview container, and it bears the static loader image. It works fine, except for crashing unpredictably without any error messages.