2016-1-10 Core Animation icon Jitter

Source: Internet
Author: User

////VIEWCONTROLLER.M//icon Jitter////Created by Mac on 16/1/11.//copyright©2016 year Mac. All rights reserved.//#import "ViewController.h"@interfaceViewcontroller () @property (weak, nonatomic) Iboutlet Uiimageview*ImageView;@end@implementationViewcontroller- (void) viewdidload {[Super viewdidload]; //additional setup after loading the view, typically from a nib.       }-(ibaction) startanimation {cakeyframeanimation*rotationani =[cakeyframeanimation animation]; Rotationani.keypath=@"transform.rotation"; //calculate the radian of the rotationCGFloat angle = M_pi_4 *0.1; //set the path of the rotationRotationani.values = @[@ (-angle), @ (angle), @ (-angle)]; Rotationani.duration=0.2; Rotationani.repeatcount=maxfloat; [Self.imageView.layer Addanimation:rotationani Forkey:@"Shake"]; }-(ibaction) endanimation {//removing animations with key[Self.imageView.layer Removeanimationforkey:@"Shake"];}- (void) didreceivememorywarning {[Super didreceivememorywarning]; //Dispose of any resources the can be recreated.}@end

2016-1-10 Core Animation icon Jitter

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.