From 3c0be362830769f3ce7789528ee537643ca50853 Mon Sep 17 00:00:00 2001 From: wangyue Date: Sun, 9 Nov 2014 02:15:58 +0800 Subject: [PATCH] rotation --- ...24-BF73-4643-9EC2-D43B75E1C73E.codesnippet | 35 ++++++++++++++++++ ...E4-E0D9-4F7A-A35D-3DF46F5ECF57.codesnippet | 36 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 CodeSnippets/327B0124-BF73-4643-9EC2-D43B75E1C73E.codesnippet create mode 100644 CodeSnippets/F41B35E4-E0D9-4F7A-A35D-3DF46F5ECF57.codesnippet diff --git a/CodeSnippets/327B0124-BF73-4643-9EC2-D43B75E1C73E.codesnippet b/CodeSnippets/327B0124-BF73-4643-9EC2-D43B75E1C73E.codesnippet new file mode 100644 index 00000000..2bfedc46 --- /dev/null +++ b/CodeSnippets/327B0124-BF73-4643-9EC2-D43B75E1C73E.codesnippet @@ -0,0 +1,35 @@ + + + + + IDECodeSnippetCompletionPrefix + transformRotationZ + IDECodeSnippetCompletionScopes + + ClassImplementation + + IDECodeSnippetContents + -(void)transformRotationZ{ + CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"]; + rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ]; + rotationAnimation.duration = <#duration#>; + rotationAnimation.cumulative = YES; + rotationAnimation.repeatCount = <#repeat#>; + + [<#view#>.layer addAnimation:rotationAnimation forKey:<#key#>]; +} + + IDECodeSnippetIdentifier + 327B0124-BF73-4643-9EC2-D43B75E1C73E + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Objective-C + IDECodeSnippetSummary + transform.rotation.z + IDECodeSnippetTitle + transformRotationZ + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 0 + + diff --git a/CodeSnippets/F41B35E4-E0D9-4F7A-A35D-3DF46F5ECF57.codesnippet b/CodeSnippets/F41B35E4-E0D9-4F7A-A35D-3DF46F5ECF57.codesnippet new file mode 100644 index 00000000..ebbe9703 --- /dev/null +++ b/CodeSnippets/F41B35E4-E0D9-4F7A-A35D-3DF46F5ECF57.codesnippet @@ -0,0 +1,36 @@ + + + + + IDECodeSnippetCompletionPrefix + rotationAnimation + IDECodeSnippetCompletionScopes + + ClassImplementation + + IDECodeSnippetContents + - (void)rotationAnimation +{ + CGAffineTransform endAngle = CGAffineTransformMakeRotation(<#angle#> * (M_PI / 180.0f)); + + [UIView animateWithDuration:0.01 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ + <#view#>.transform = endAngle; + } completion:^(BOOL finished) { + <#angle#> += 10; + [self rotationAnimation]; + }]; +} + IDECodeSnippetIdentifier + F41B35E4-E0D9-4F7A-A35D-3DF46F5ECF57 + IDECodeSnippetLanguage + Xcode.SourceCodeLanguage.Objective-C + IDECodeSnippetSummary + rotationAnimation + IDECodeSnippetTitle + rotationAnimation + IDECodeSnippetUserSnippet + + IDECodeSnippetVersion + 0 + +