UILabel *l=[[UILabel alloc]initWithFrame:CGRectMake(50, 15, 50, 50)];
l.text=@"H";
l.textColor=[UIColor redColor];
[self.v addSubview:l];
_v.backgroundColor=[UIColor lightGrayColor];
self.v.layer.cornerRadius = _v.frame.size.width / 2.0 ;
_v.clipsToBounds=true;
[self rotateSpinningView];
- (void)rotateSpinningView
{
[UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
[_v setTransform:CGAffineTransformRotate(_v.transform, M_PI_2)];
} completion:^(BOOL finished) {
if (finished && !CGAffineTransformEqualToTransform(_v.transform, CGAffineTransformIdentity)) {
[self rotateSpinningView];
}
}];
}
l.text=@"H";
l.textColor=[UIColor redColor];
[self.v addSubview:l];
_v.backgroundColor=[UIColor lightGrayColor];
self.v.layer.cornerRadius = _v.frame.size.width / 2.0 ;
_v.clipsToBounds=true;
[self rotateSpinningView];
- (void)rotateSpinningView
{
[UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{
[_v setTransform:CGAffineTransformRotate(_v.transform, M_PI_2)];
} completion:^(BOOL finished) {
if (finished && !CGAffineTransformEqualToTransform(_v.transform, CGAffineTransformIdentity)) {
[self rotateSpinningView];
}
}];
}
Sign up here with your email
ConversionConversion EmoticonEmoticon