Last active
December 14, 2015 12:28
-
-
Save gregtemp/5086125 to your computer and use it in GitHub Desktop.
animationDuration (quick changes)
what am i doing wrong here?
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, *s2; | |
NSInteger sw; | |
} | |
-(void)setup { | |
sw = 1; | |
[self setupShapes]; | |
} | |
-(void) setupShapes { | |
CGRect rect = CGRectMake(0, 0, 100, 100); | |
//s1 = [C4Shape rect:rect]; | |
s2 = [C4Shape ellipse:rect]; | |
CGPoint currentCenter = self.canvas.center; | |
//s1.center = currentCenter; | |
s2.center = currentCenter; | |
//[self.canvas addShape:s1]; | |
[self.canvas addShape:s2]; | |
s2.alpha = 0.0f; | |
s2.userInteractionEnabled = NO; | |
} | |
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { | |
CGPoint touchedPoint = [[touches anyObject] locationInView:self.view]; | |
s2.animationDuration = 0.0f; | |
s2.center = touchedPoint; | |
s2.alpha = 1.0f; | |
} | |
-(void) touchesEnded { | |
s2.animationDuration = 1.0f; | |
s2.alpha = 0.0f; | |
} | |
@end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment