0% found this document useful (0 votes)
4 views1 page

Picnic App Implementation Code Sample

This document contains code snippets from a picnic application implementation file. It includes code to animate a bug moving left and then facing right by rotating it 180 degrees, as well as code to tap on a view and log a message. Variables are declared to reference different picnic item views.

Uploaded by

Vickey Rawat
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Picnic App Implementation Code Sample

This document contains code snippets from a picnic application implementation file. It includes code to animate a bug moving left and then facing right by rotating it 180 degrees, as well as code to tap on a view and log a message. Variables are declared to reference different picnic item views.

Uploaded by

Vickey Rawat
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

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:)]; [Link] = 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:)]; [Link] = CGAffineTransformMakeRotation(M_PI); [UIView commitAnimations]; }

You might also like