There are many ways to implement three-bit rotation animations, here are three
One: UIView
1 [UIView animatewithduration:1.0 animations:^{2 self.iconView.layer.transform = catransform3dmakerotation (m_pi_2, 0, 1, 0); 3 } completion:^ (BOOL finished) {4 self.iconView.image = [UIImage imagenamed:@ "User_ Defaultgift "];5 6 [UIView animatewithduration:1.0 animations:^{7 self.iconView.layer.transform = Catransform3dmakerotation (M_PI, 0, 1, 0); 8 }];9 }];
II: Catransition Custom
1 CATransition2 catransition *anim = [catransition animation];3 anim.duration = 1.0;4 Anim.type = @ " Rippleeffect "; 5 [Self.iconView.layer Addanimation:anim Forkey:nil];
Three: Catransition
1 2 [UIView transitionWithView:self.iconView duration:1.0 options: Uiviewanimationoptiontransitionflipfromleft animations:^{3 self.iconView.image = [UIImage imagenamed:@ "User_ Defaultgift "]; 4 } completion:^ (BOOL finished) {5 dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (1.0 * Nsec_per _SEC)), Dispatch_get_main_queue (), ^{6 [UIView transitionWithView:self.iconView duration:1.0 options: Uiviewanimationoptiontransitionflipfromright animations:^{7 self.iconView.image = [UIImage imagenamed:@] Default_avatar "]; 8 } Completion:nil]; 9 }); }];11}
iOS Development--Practical technical Articles & three-dimensional rotational animation