Skip to content

Commit

Permalink
Updated examples to support the new animation directions (top left, b…
Browse files Browse the repository at this point in the history
…ottom left, top right, bottom right)
  • Loading branch information
neror committed Oct 13, 2010
1 parent 30231a8 commit 694c192
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions Examples/BackInOut.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ - (void)viewDidLoad {

- (void)performAnimation:(id)sender {
if(self.viewToAnimate.hidden) {
//[self.viewToAnimate backInFrom:self.directionControl.selectedSegmentIndex+4 withFade:NO duration:.4 delegate:nil];
[self.viewToAnimate backInFrom:self.directionControl.selectedSegmentIndex+4 inView:self.viewToAnimate.superview withFade:NO duration:0.4 delegate:nil startSelector:nil stopSelector:nil];
[self.viewToAnimate backInFrom:self.directionControl.selectedSegmentIndex inView:self.viewToAnimate.superview withFade:NO duration:0.4 delegate:nil startSelector:nil stopSelector:nil];
} else {
//[self.viewToAnimate backOutTo:self.directionControl.selectedSegmentIndex+4 withFade:NO duration:.4 delegate:nil];
[self.viewToAnimate backOutTo:self.directionControl.selectedSegmentIndex+4 inView:self.viewToAnimate.superview withFade:NO duration:0.4 delegate:nil startSelector:nil stopSelector:nil];
[self.viewToAnimate backOutTo:self.directionControl.selectedSegmentIndex inView:self.viewToAnimate.superview withFade:NO duration:0.4 delegate:nil startSelector:nil stopSelector:nil];

}
}
Expand Down
2 changes: 1 addition & 1 deletion Examples/SimpleAnimationExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ - (void)loadView {
[self.performAnimationButton setTitle:@"Run Animation" forState:UIControlStateNormal];
[self.performAnimationButton addTarget:self action:@selector(performAnimation:) forControlEvents:UIControlEventTouchUpInside];

NSArray *directionItems = [NSArray arrayWithObjects:@"Top", @"Right", @"Bottom", @"Left", nil];
NSArray *directionItems = [NSArray arrayWithObjects:@"T", @"R", @"B", @"L", @"TL", @"TR", @"BL", @"BR", nil];
self.directionControl = [[[UISegmentedControl alloc] initWithItems:directionItems] autorelease];
self.directionControl.selectedSegmentIndex = 0;
self.directionControl.frame = CGRectMake(10., 300., 300., 44.);
Expand Down
6 changes: 2 additions & 4 deletions Examples/SlideInOut.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ - (void)viewDidLoad {

- (void)performAnimation:(id)sender {
if(self.viewToAnimate.hidden) {
//[self.viewToAnimate slideInFrom:self.directionControl.selectedSegmentIndex duration:.4 delegate:nil];
[self.viewToAnimate slideInFrom:self.directionControl.selectedSegmentIndex+4 inView:self.viewToAnimate.superview duration:0.4 delegate:nil startSelector:nil stopSelector:nil];
[self.viewToAnimate slideInFrom:self.directionControl.selectedSegmentIndex inView:self.viewToAnimate.superview duration:0.4 delegate:nil startSelector:nil stopSelector:nil];
} else {
//[self.viewToAnimate slideOutTo:self.directionControl.selectedSegmentIndex duration:.4 delegate:nil];
[self.viewToAnimate slideOutTo:self.directionControl.selectedSegmentIndex+4 inView:self.viewToAnimate.superview duration:0.4 delegate:nil startSelector:nil stopSelector:nil];
[self.viewToAnimate slideOutTo:self.directionControl.selectedSegmentIndex inView:self.viewToAnimate.superview duration:0.4 delegate:nil startSelector:nil stopSelector:nil];

}
}
Expand Down

0 comments on commit 694c192

Please sign in to comment.