How to set modal segue animation the same as push segue animation? - iphone

There are four kinds of animations provided by apple with the modal segue. But neither is my favorite, I prefer the animation like the push segue animation? How could I archive it? Is there any open source code for custom segue with different animations? Thanks in advance!
ps. Actually I have a tabView with several child view, one of them is a tableView, each cell will drill in an detail view. It is normal to push the detail view, but I do not want the tab bar come into the detail view as well. Then I choose modal the detail view. But i prefer the push animation.

After seeing your comment I figured this would help. There is a setting to hide your tabBar when pushing instead of you having to fake a push with a modal transition.
Also in code can be easier. Check out this SO Hiding UITabBar when pushing a UIView

Related

UINavigationController Push Segue - Strange animation

I have a UINavigationController which was created in Storyboards, and connected with push segues for each view controller. However, when I click "next" (which activates the push segue), then animation going forward is strange. (See: https://www.youtube.com/watch?v=0cFo9sUtBeM). Going back (Selecting the root controller of the UINavController in the UITabBarController) has the correct animation though. Any ideas why this could be?
Edit: the boxes in the video are added by me to protect client identity. The animation issue detailed is the slide animation which appears to come from the top right (or top left for the 'next' button).
It appears that setting a different Prompt for the navigation bar on the second view controller causes this weird animation effect. After removing the prompt, the animation now works as expected.
It looks like a navigation controller push and a modal transition. If I had to wager, I'd guess you have a modal transition hooked up to the button in storyboard, and code in the action method for the button doing a pushViewController:animated: on self.navigationController - (either that or the other way around, with a push hooked up in storyboard).
If that's the case, start by commenting out any button action code (any target/selector you setup in code, or any IBAction you setup in storyboard for that button).
I also recently had this problem using a Master Detail storyboard with an embedded Navigation Controller. The issue was fixed when I changed the Background of the View of the Detail screen from Default to a different color. I found it did not make any difference which color as long as it was not Default. I hope that this helps someone.

Can i add a Navigation Controller to a ModalViewController?

I want to present a Modal view in the middle of the screen in on an iPad. This view will have a search bar and a table view. It will present search results. This is up and running.
Now i need to add a navigation controller so that upon touching a row in the above table view, a detail view will be pushed in from the right to allow the user to determine if this is the item he wanted.
I tried adding a navigation controller to my modal view but it doesn't display and i couldn't find a tutorial for this.
Can someone please give me a hint?
EDIT: I'm starting to think that i first need to push a modal navigation controller and then add the tableview to this, is this the correct approach? Can someone please give some details on this if that's the case?
Yes this is possible. You have to present the NavigationController modal. Your ViewController will be the rootViewController of the UINavigationController.
I posted some code in Adding UINavigationController to existing UIViewController

UIToolbar push view issue

I've created a UIToolbar and added it as a subview of the navigationController. The problem is it doesn't disappear when I do push so I hide it on push but the makes it just disappear which makes it look tacky. I thought about animating it but I am finding it hard for the animation to be exactly like the push and pop animation for the navigation controller.
Does anyone know the push and pop animation properties so it can be exactly the same, or does anyone know what view or what property i can do to push and pop the toolbar with the navigation controller.
As a note I also tried to use the toolbar that comes with the navigationController but the buttons were disappearing after popping back to the view.
Yup, check out the hidesBottomBarWhenPushed property of the UIViewController that you are push/popping.

Non-Modal view without NavigationController

I have an app built from the UITabBarController starter project. The first tab is part of the main.xib that contains the tab bar. I would like to slide a view up from the bottom on top of that tab's view that only covers part of the screen. My understanding is that you can only cover part of the screen if you make the top view non-modal, but I don't see a way to do that without a NavigationController.
How can I do this?
you can add a UIView as a subview to the current view, and then animate its appearance into the screen using animation blocks, or Quartz or however you would like.
presentModalViewController: is actually a method that belongs to UIViewController, the superclass of UINavigationController, so you can use it from any view controller, not just a navigation controller.
Have you tried using a UIActionSheet? That's an easy way to get a view with a few buttons for user input to slide up and only cover the bottom portion of the current view.

How do you use Interface Builder to control UINavigationControllers properly?

I have been in the process of learning to build iPhone applications for the last two weeks. I've gotten through a fair amount of content, and now I'm trying to create a modal pop up with presentModalView.
I can can successfully create and slide up a view, but I notice that modal views don't provide you with a default navigation bar at the top of the window, which makes sense for flexibility I guess. Most modal views I've seen have a "Cancel" and a "Done" or "Save" button as navigationItems on what looks to be a UINavigationController. My thought then was just to instantiate a navigation controller and push the single view onto the view controller stack, and presentModalView:navController.view ...
Because the view is relatively complex, I was trying to lay out both the UINavigationController, with the bar buttons, and the view I was hoping to push onto the stack in a single xib -- no matter what I try, I can't seem to get the linkages correct. Can you even do this? Or should I create a separate class/xib for the view I'm going to be pushing onto the navigation controller? Seems like a lot of classes and files for one screen, so my feeling is I must be missing something.
At this point, I could have done it programmatically about an hour and a half ago... however, this is a real nag, since IB seems GREAT for some things. Anyone have an experience with a situation like this?
Thanks,
Josh
If you're not going to use this new XIB for navigation, there's no point in making a navigation controller.
In interface builder, simply drag a UINavigationBar to the top of your view, and add a "Done" Button. Now, add an IBAction to the done button to dismiss the view controller. Your ViewController code for the dismiss IBAction should look something like this:
-(IBAction)dismiss {
//Any logic before dismissing the modal view
[super dismissModalViewControllerAnimated:YES];
}