You are on page 1of 1

Sample Work

Piece of Implementation File of my Picnic Application


#import "PicnicViewController.h" #import <AudioToolbox/AudioToolbox.h> @implementation PicnicViewController @synthesize basketTop; @synthesize basketBottom; @synthesize napkinTop; @synthesize napkinBottom; @synthesize bug;

- (void)viewTapped:(UITapGestureRecognizer *)sender { NSLog(@"View tapped!"); } - (void)moveToLeft:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { if (bugDead) return; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationDelay:2.0]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(faceRight:finished:context:)]; bug.center = CGPointMake(75, 200); [UIView commitAnimations]; } - (void)faceRight:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { if (bugDead) return; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationDelay:0.0]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(moveToRight:finished:context:)]; bug.transform = CGAffineTransformMakeRotation(M_PI); [UIView commitAnimations]; }

You might also like