I want to change to another tab but i also want to open it from bottom. Like a vertical transition.
I was trying to do like this :
-(void)test{
UIView * toView = [[self.tabBarController.viewControllers objectAtIndex:1] view];
UIImage *img=[self imageWithView:toView];
[UIView transitionWithView:img
duration:1.0f
options:UIViewAnimationOptionCurveEaseIn
animations:^{
self.tabBarController.selectedIndex = 0;
} completion:NULL];
}
- (BOOL)tabBarController:(UITabBarController *)tabBarController
shouldSelectViewController:(UIViewController *)viewController{
return false;
}
- (UIImage *) imageWithView:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
but it's not the effect that i want . Any ideea?