Created
March 4, 2013 22:24
-
-
Save gregtemp/5086240 to your computer and use it in GitHub Desktop.
animationDuration problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// C4WorkSpace.m | |
// Examples | |
// | |
// Created by Greg Debicki. | |
// | |
#import "C4WorkSpace.h" | |
@implementation C4WorkSpace { | |
C4Shape *s1; | |
} | |
-(void)setup { | |
[self setupShapes]; | |
} | |
-(void) setupShapes { | |
CGRect rect = CGRectMake(0, 0, 100, 100); | |
s1 = [C4Shape ellipse:rect]; | |
CGPoint currentCenter = self.canvas.center; | |
s1.center = currentCenter; | |
[self.canvas addShape:s1]; | |
s1.alpha = 0.0f; | |
s1.userInteractionEnabled = NO; | |
} | |
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
CGPoint touchedPoint = [[touches anyObject] locationInView:self.view]; | |
s1.animationDuration = 0.0f; | |
s1.center = touchedPoint; | |
s1.alpha = 1.0f; | |
s1.animationDuration = 1.0f; | |
s1.alpha = 0.0f; | |
} | |
@end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment