Skip to content

Instantly share code, notes, and snippets.

@minch
Created July 24, 2013 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minch/6071240 to your computer and use it in GitHub Desktop.
Save minch/6071240 to your computer and use it in GitHub Desktop.
Add sub view
- (IBAction)swipedDown:(id)sender {
CGPoint location = [sender locationInView:self.view];
NSLog(@"swiped down at %f, %f", location.x, location.y);
NSString *viewName = @"TaskQuickCreateView";
TaskQuickCreateView *view = [[NSBundle mainBundle]
loadNibNamed:viewName
owner:self
options:nil][0];
CATransition *animation = [CATransition animation];
[animation setDuration:0.5];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromBottom];
[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[self.view addSubview:view];
//[animation setDelegate:self];
[[view layer] addAnimation:animation forKey:viewName];
// NSLog(@"view %@", view);
// [self.navigationController.view addSubview:view];
// [[self.navigationController.view layer] addAnimation:animation forKey:viewName];
// [UIView transitionWithView:self.navigationController.view
// duration:0.5
// options:UIViewAnimationOptionTransitionCrossDissolve
// animations:^{
// [self.navigationController.view addSubview:view];
// }
// completion:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment