I Am creating an application and i want to achieve push effect but without using navigation controller.Does someone knows a core animation source code to achieve this? I have a view hierarchy like this.A main controller which has an header image with 4 buttons on it.I mean it will be displayed all the time whatever view in front of screen is.So i use add subview methods.Now in some view i want to navigate further when cliking on table view cell but unabvle to figure out how to achieve that navigation animation?
here is the code to adding subviews....
-(IBAction)ShowDashBoardContentView
{
if(ButtonDashBoard.selected==YES)
[ButtonDashBoard setSelected:YES];
else
{
[ButtonDashBoard setSelected:YES];
[ButtonFreebies setSelected:NO];
[self.FreebiesViewMainObject.view removeFromSuperview];
[ButtonConnect setSelected:NO];
[self.ConnectContentViewObject.view removeFromSuperview];
[ButtonDeals setSelected:NO];
[self.DealsViewMainObject.view removeFromSuperview];
}
if(DashBoardContentView==nil)
{
DashBoardContent *vController =[[DashBoardContent alloc] initWithNibName:@"DashBoardContent" bundle:[NSBundle mainBundle]];
vController.view.frame=CGRectMake(0, 90, 320, 370);
self.DashBoardContentView=vController;
[vController release];
}
[self.DashBoardContentView viewWillAppear:YES];
[self.view addSubview:[self.DashBoardContentView view]];
[self BringSubviewsToFront];
}
-(IBAction)ShowConnectContentView
{
if(ButtonConnect.selected==YES)
[ButtonConnect setSelected:YES];
else
{
[ButtonConnect setSelected:YES];
[ButtonFreebies setSelected:NO];
[self.FreebiesViewMainObject.view removeFromSuperview];
[ButtonDashBoard setSelected:NO];
[self.DashBoardContentView.view removeFromSuperview];
[ButtonDeals setSelected:NO];
[self.DealsViewMainObject.view removeFromSuperview];
}
if(ConnectContentViewObject==nil)
{
ConnectContentView *vController =[[ConnectContentView alloc] initWithNibName:@"ConnectContentView" bundle:[NSBundle mainBundle]];
vController.view.frame=CGRectMake(0, 90, 320, 370);
self.ConnectContentViewObject=vController;
[vController release];
}
[self.ConnectContentViewObject viewWillAppear:YES];
[self.view addSubview:[self.ConnectContentViewObject view]];
[self BringSubviewsToFront];
}
-(IBAction)ShowDealsView
{
if(ButtonDeals.selected==YES)
[ButtonDeals setSelected:YES];
else
{
[ButtonDeals setSelected:YES];
[ButtonFreebies setSelected:NO];
[self.FreebiesViewMainObject.view removeFromSuperview];
[ButtonDashBoard setSelected:NO];
[self.DashBoardContentView.view removeFromSuperview];
[ButtonConnect setSelected:NO];
[self.ConnectContentViewObject.view removeFromSuperview];
}
if(DealsViewMainObject==nil)
{
DealsViewMain *vController =[[DealsViewMain alloc] initWithNibName:@"DealsViewMain" bundle:[NSBundle mainBundle]];
vController.view.frame=CGRectMake(0, 90, 320, 370);
self.DealsViewMainObject=vController;
[vController release];
}
[self.DealsViewMainObject viewWillAppear:YES];
[self.view addSubview:[self.DealsViewMainObject view]];
[self BringSubviewsToFront];
}
-(IBAction)ShowFreebiesView
{
if(ButtonFreebies.selected==YES)
[ButtonFreebies setSelected:YES];
else
{
[ButtonFreebies setSelected:YES];
[ButtonDeals setSelected:NO];
[self.DealsViewMainObject.view removeFromSuperview];
[ButtonDashBoard setSelected:NO];
[self.DashBoardContentView.view removeFromSuperview];
[ButtonConnect setSelected:NO];
[self.ConnectContentViewObject.view removeFromSuperview];
}
if(FreebiesViewMainObject==nil)
{
FreebiesViewMain *vController =[[FreebiesViewMain alloc] initWithNibName:@"FreebiesViewMain" bundle:[NSBundle mainBundle]];
vController.view.frame=CGRectMake(0, 90, 320, 370);
self.FreebiesViewMainObject=vController;
[vController release];
}
[self.FreebiesViewMainObject viewWillAppear:YES];
[self.view addSubview:[self.FreebiesViewMainObject view]];
[self BringSubviewsToFront];
}
-(void)BringSubviewsToFront
{
[self.view bringSubviewToFront:HeaderView];
[self.view bringSubviewToFront:ButtonDeals];
[self.view bringSubviewToFront:ButtonDashBoard];
[self.view bringSubviewToFront:ButtonConnect];
[self.view bringSubviewToFront:ButtonFreebies];
}
Now the DealsViewMainObject contains a tableview and i need to navigate further from here.also while removing view from superview how to animate like popviewcontroller animated? BTW thanks for the answer Felixyz.