How do I make the flip animation on a modal view on the iPad transparent in the background? - ios

How do I make my flip animation transparent so the view behind it is shown through?
Here's some of my code:
EditInfoViewController *editController = [[EditInfoViewController alloc] initWithNibName:#"EditInfoViewController" bundle:nil];
editController.delegate = self;
UINavigationController *editNavController = [[UINavigationController alloc] initWithRootViewController:editController];
editNavController.modalPresentationStyle = UIModalPresentationCurrentContext;
editNavController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController presentModalViewController:editNavController animated:YES];
A picture is worth 1000 words (this was taken during the flip animation):

Related

Panel sliding from the bottom

I want to implement panel, that by default appears from the bottom only by 1/4.
And when i tap on this part, or swipe it, it should roll out on full screen.
exactly what i want was implemented in this app
So what i tried already:
Making UIView and trying to apply tap and swipe gestures. UIView didn't catch it. But it caught touchesMoved, touchesEnded etc.
UITableView. Same.
Making UIViewController. Ended without any idea how to handle it to right way.
So any ideas or links are appreciated.
Thanks in advance.
Check PPRevealSideViewController https://github.com/ipup/PPRevealSideViewController, I think you can find what you need.
When you tap on the new viewController you can change the Offset.
AppDelegate.m
MainViewController *main = [[MainViewController alloc] init];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:#"Main" bundle:nil];
main = [storyboard instantiateViewControllerWithIdentifier:#"MainViewControllerr"];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:main];
_revealSideViewController = [[PPRevealSideViewController alloc] initWithRootViewController:nav];
_revealSideViewController.delegate = self;
self.window.rootViewController = _revealSideViewController;
MainViewController.m
-(void)popViewController{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:#"Main" bundle:nil];
PoppedViewController *pvc = [storyboard instantiateViewControllerWithIdentifier:#"PoppedViewController"];
[self.revealSideViewController pushViewController:pvc onDirection:PPRevealSideDirectionBottom withOffset:_offset animated:_animated completion:nil];
}
PoppedViewController.m
-viewDidLoad{
//...
UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:#selector(getFullView)];
gesture.delegate = self;
[self.view addGestureRecognizer:gesture];
}
-getFullView{
[self.revealSideViewController changeOffset:0.0f forDirection:PPRevealSideDirectionLeft];
}

iOS 8: Transition from UINavigationController to UISplitViewController, bad animation

I'm trying to animate a transition from a UINavigationController to a UISplitViewController, but the split view controller doesn't draw correctly until the animation is finished. The navigation bars are transparent and their titles are positioned wrong. When the animation finishes, they jump to the "correct" location. I'm using
-transitionFromViewController:toViewController:duration:options:animations:completion
The UISplitViewController has UINavigationControllers for both its master and detail. As it is transitioning in, the navigation bar is dark gray and the title is offset too high. Once the animation finishes, the bar quickly changes color to light gray and the title jumps into the correct place. Here's some example code:
// Master and its nav
UIViewController *master = [[UIViewController alloc] init];
master.title = #"master";
UINavigationController *masterNav = [[UINavigationController alloc] initWithRootViewController:master];
masterNav.toolbarHidden = NO;
// Detail and its nav
UIViewController *detail = [[UIViewController alloc] init];
detail.title = #"detail";
UINavigationController *detailNav = [[UINavigationController alloc] initWithRootViewController:detail];
// Split
UISplitViewController *splitViewController = [[UISplitViewController alloc] init];
splitViewController.viewControllers = #[ masterNav, detailNav ];
// Now transition
UIViewController *from = [self.childViewControllers lastObject];
[self addChildViewController:splitViewController];
NSTimeInterval duration = 1.0;
UIViewAnimationOptions options = UIViewAnimationOptionTransitionCrossDissolve;
[self transitionFromViewController:from
toViewController:splitViewController
duration:duration
options:options
animations:^{}
completion:^(BOOL finished) {
[splitViewController didMoveToParentViewController:self];
}];

iPad center custom modal view

I have an application with custom modal view controller and this controller is inside navigation controller here is my code:
CalendarViewController *calendarViewController = [[CalendarViewController alloc] initWithNibName:#"CalendarViewController" bundle:nil];
[calendarViewController setDelegate:self];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:calendarViewController];
[navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
[navigationController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:navigationController animated:YES];
navigationController.view.superview.frame = CGRectMake(0, 0, 630, 555);
navigationController.view.superview.center = self.view.center;
Problem is that this navigation controller is not center on screen. Location of this screen is right side of ipad. Is there a solution how center this custom controller. Thanks a lot.

Shutter animation messed up when adding UIImagePickerController as subview

I'm adding UIImagePickerController as a subview of my UINavigationController which is inside a UIPopoverController.
Heres the code:
UIViewController *container = [[UIViewController alloc] init];
self.navigationBarHidden = YES;
camera = [[UIImagePickerController alloc] init];
camera.sourceType = UIImagePickerControllerSourceTypeCamera;
[container addChildViewController:camera];
[container.view setFrame:camera.view.frame];
[container.view addSubview:camera.view];
[self pushViewController:container animated:YES];
Everything looks great but the shutter animation. It seems to be off center, where the middle of the iris is actually hitting the top of the view.
How do I fix the shutter animation?

modalPresentationStyle not working in modal view in iOS5

I want to display a popup window in iPad using the UIView's presentModalViewController method in iOS5.
Even though I set the modalPresentationStyle to UIModalPresentationFormSheet, it only displays as full frame size.
I used the same code in iOS4 before, and it can display as a popup window. How to fix it in iOS5?
DetailViewController *d = [[DetailViewController alloc] initWithNibName:nil bundle:nil];
self.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:d animated:YES];
Thanks.
Have you try
d.modalPresentationStyle = UIModalPresentationFormSheet;
instead of
self.modalPresentationStyle = UIModalPresentationFormSheet;
In iOS5, the modal view should be used as below.
DetailViewController *d = [[DetailViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:d];
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:navigationController animated:YES];

Resources