iOS Development--Practical technical Articles & three-dimensional rotational animation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.