I have add Facebook like menu in my app. For that i have create two ViewController. On menu button click add LeftViewController as childViewController .its working fine as shown in image. here is my code:-
[self addChildViewController:left];
[self showMenu];
[view_mainHome addSubview:left.view];
[left didMoveToParentViewController:self];
Now i call a function of ParentViewController to close this view from childViewController i.e (LeftViewController). So the problem is method is called but view not animate.I am calling method like :- ParentViewController * parent = [[ParentViewController alloc]init]; [parent hideLeftMenu];
My method in ParentViewController.m like:-
-(void)hideLeftMenu{
LeftMenuViewController *left=[[LeftMenuViewController alloc]init];
[left removeFromParentViewController];
//slide the content view to the left to hide the menu
[UIView animateWithDuration:.5 animations:^{
self.navigationController.navigationBar.frame = CGRectMake(0, self.navigationController.navigationBar.frame.origin.y, self.navigationController.navigationBar.frame.size.width, self.navigationController.navigationBar.frame.size.height);
[view_Home setFrame:CGRectMake(0, view_Home.frame.origin.y, view_Home.frame.size.width, view_Home.frame.size.height)];
}completion:^(BOOL finished)
{
for(UIView *view in [view_mainHome subviews]){
[view removeFromSuperview];
}
}];
}