Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I am trying to implement a custom UIActionSheet(made up of a ViewController)
- I have added a View Controller as a subView to the navigationcontroller of my rootView
- - (IBAction)ShowMenu:(id)sender
- {
- [self.navigationController.view addSubview:self.menuViewController.view];
- [self.menuViewController setTest:YES];
- [self.menuViewController viewWillAppear:YES];
- }
- here MenuViewController has a tableview which has few options to select. After selecting I am opening those respective ViewControllers. Suppose I clicked on menu1 and then opened menu1ViewController and it works fine. Now when I close this viewController, I am calling dismissViewController.
- and in menuViewController I have written the code to animate by menuviewController to bottom and it works fine.
- but the parent of MenuView is TestViewController inside which the functions viewdidAppear is not called when menuviewController animates down.
- and thats my problem,
- I am using this code to animate by menuViewController to bottom
- - (void) slideOut {
- [UIView beginAnimations:@"removeFromSuperviewWithAnimation" context:nil];
- // Set delegate and selector to remove from superview when animation completes
- [UIView setAnimationDelegate:self];
- [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
- // Move this view to bottom of superview
- CGRect frame = self.menusheet.frame;
- frame.origin = CGPointMake(0.0, self.view.bounds.size.height);
- self.menusheet.frame = frame;
- [UIView commitAnimations];
- }
- // Method called when removeFromSuperviewWithAnimation's animation completes
- - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
- if ([animationID isEqualToString:@"removeFromSuperviewWithAnimation"]) {
- [self.view removeFromSuperview];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement