iOS 18th day (3,calayer implicit animation)

Source: Internet
Author: User

Implicit animation (finger-dragging layer)

#import "HMViewController.h"@interfaceHmviewcontroller () @property (nonatomic, weak) Calayer*layer;@end@implementationHmviewcontroller- (void) viewdidload{[Super Viewdidload]; //additional setup after loading the view, typically from a nib.Calayer*layer =[Calayer layer]; //Set DimensionsLayer.bounds = CGRectMake (0,0, -, -); //ColorLayer.backgroundcolor =[Uicolor Redcolor].        Cgcolor;        [Self.view.layer Addsublayer:layer]; _layer=layer; }- (void) Touchesbegan: (Nsset *) touches withevent: (Uievent *)Event{    //Get Touch PointUitouch *touch =[touches anyobject]; Cgpoint POS=[Touch LocationInView:self.view]; //Open Transaction//[catransaction begin]; //Cancel hidden Animation//[Catransaction Setdisableactions:yes];//_layer.position = cgpointmake (100, 100); //Set Border_layer.borderwidth = Arc4random_uniform (5) +1; CGFloat R= Arc4random_uniform ( the) /255.0; CGFloat g= Arc4random_uniform ( the) /255.0; CGFloat b= Arc4random_uniform ( the) /255.0;//_layer.bordercolor = [Uicolor colorwithred:r green:g blue:b alpha:1].        Cgcolor; //Set Background color_layer.backgroundcolor = [Uicolor colorwithred:r green:g blue:b Alpha:1].        Cgcolor; //set the fillet radius_layer.cornerradius = Arc4random_uniform ( -); //Set Location_layer.position =POS; //Commit a transaction//[Catransaction commit];}@end

iOS 18th day (3,calayer implicit 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.