Skip to content

Instantly share code, notes, and snippets.

@gregtemp
Created March 4, 2013 22:24
Show Gist options
  • Save gregtemp/5086240 to your computer and use it in GitHub Desktop.
Save gregtemp/5086240 to your computer and use it in GitHub Desktop.
animationDuration problem
//
// 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