Created
April 5, 2013 22:32
-
-
Save C4Examples/5323217 to your computer and use it in GitHub Desktop.
C4Control runMethodWithObject
This file contains hidden or 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. | |
| // | |
| @implementation C4WorkSpace { | |
| C4Shape *s; | |
| } | |
| -(void)setup { | |
| s = [C4Shape ellipse:CGRectMake(0, 0, 200, 200)]; | |
| s.center = self.canvas.center; | |
| [self.canvas addShape:s]; | |
| } | |
| -(void)touchesBegan { | |
| [self runMethod:@"changeFillColor:" withObject:s afterDelay:1.0f]; | |
| } | |
| -(void)changeFillColor:(C4Shape *)shape { | |
| shape.fillColor = [UIColor colorWithRed:[C4Math randomInt:100]/100.0f | |
| green:[C4Math randomInt:100]/100.0f | |
| blue:[C4Math randomInt:100]/100.0f | |
| alpha:1.0f]; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment