Skip to content

Instantly share code, notes, and snippets.

@minch
Created July 24, 2013 14:43
Show Gist options
  • Select an option

  • Save minch/6071240 to your computer and use it in GitHub Desktop.

Select an option

Save minch/6071240 to your computer and use it in GitHub Desktop.

Revisions

  1. Adam Weller created this gist Jul 24, 2013.
    35 changes: 35 additions & 0 deletions add-sub-view
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    - (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];

    }