Three-dimensional rotation animation
There are many ways to implement three-bit rotation animations, here are three
One: UIView
1[UIView animatewithduration:1.0animations:^{2Self.iconView.layer.transform = Catransform3dmakerotation (m_pi_2,0,1,0);3} completion:^(BOOL finished) {4Self.iconView.image = [UIImage imagenamed:@"User_defaultgift"];5 6[UIView animatewithduration:1.0animations:^{7Self.iconView.layer.transform = Catransform3dmakerotation (M_PI,0,1,0);8 }];9}];
II: Catransition Custom
1 catransition 2 Catransition *anim = [catransition animation]; 3 1.0 ; 4 @" Rippleeffect " ; 5 [Self.iconView.layer Addanimation:anim Forkey:nil];
Three: Catransition
1 2[UIView transitionWithView:self.iconView Duration:1.0Options:uiviewanimationoptiontransitionflipfromleft animations:^{3Self.iconView.image = [UIImage imagenamed:@"User_defaultgift"];4} completion:^(BOOL finished) {5Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (1.0* nsec_per_sec)), Dispatch_get_main_queue (), ^{6[UIView transitionWithView:self.iconView Duration:1.0Options:uiviewanimationoptiontransitionflipfromright animations:^{7Self.iconView.image = [UIImage imagenamed:@"Default_avatar"];8 } Completion:nil];9 });Ten }]; One}
iOS Development--Practical technical Articles & three-dimensional rotational animation