Push view controller in navigation controller with interactive transition - ios

I have a view at the bottom of my view controller. How can I set up an interactive transition such that as I drag the view up vertically (perhaps using UIPanGestureRecognizer), another view controller is pushed up?
Similar to the default navigation controller behaviour with swiping left and right to push/pop, except this would be vertical.

You can use UIDynamicAnimator class for animation.
You will have to use AttachmentBehavior for such kind of attachment animation. It's subclass of UIDynamicAnimator. Please check this question. It might help you.

Related

View Controller Transparent Background

How can I create a view controller with a transparent background that overlays another view controller where the bottom view controller is still visible in iOS 9? The way that works in iOS 8 no longer works.
First you can set overlaid view controller's background colour as clear colour.
You can use presentViewController method to overlay new view controller.
This from apple docs
When presenting a view controller using the UIModalPresentationFullScreen style, UIKit normally removes the views of the underlying view controller after the transition animations finish. You can prevent the removal of those views by specifying the UIModalPresentationOverFullScreen style instead.
So you can set overlaid view controller's modalPresentationStyle to UIModalPresentationOverFullScreen
I also hope this may be help
When using one of the full-screen presentation styles, the view controller that initiates the presentation must itself cover the entire screen. If the presenting view controller does not cover the screen, UIKit walks up the view controller hierarchy until it finds one that does. If it can’t find an intermediate view controller that fills the screen, UIKit uses the root view controller of the window.
To solve this problem you just have to change the Alpha information of your View. To get this view on top of others, change the Transition Style of the ViewController.
FYI: The syntax is now:
childVC.modalPresentationStyle = UIModalPresentationStyle.OverFullScreen

How to fade whole screen

I am presenting a temporary view on top of my view controller when a user does some action.
I want it to fade the screen - including the navigation bar, like UIActionSheet does.
I am presenting the view via the root view controller of the navigation controller, so my only problem is to fade also the navigation bar and not allow touches on it.
How can I do that?
You can add a semi-transparent view on the whole UIWindow and it'll look just as you described it. You'd probably want to add your temporary view there, too, because all actions will be blocked by the semi-transparent view.

iOS: How to get a modal view to partially cover the parent view?

I am quite new in iOS development and I am facing an issue with the design of navigation. So my goal is simple: I have a view with a right navigation button which I want to open a modal view that would partially cover the parent view like on this screenshot: modal view example
Currently this is what I did: I embedded a UIViewController in a UINavigationController, then I added a right navigation button in my view controller which navigates to another UIViewController through a modal action segue. But whenever I navigate to the modal view, it fully covers the parent view.
So how can I get it to only cover partially the parent view with Interface Builder settings? Or do I need to use some code behind to achieve that?
Thanks for your help :)
NB: I don't want to use Popovers, I want it to be in the middle of the screen with no attach.
To achieve this you have to select your segue and modify the Presentation property to Form Sheet, as shown in the image below

Using iOS 6 autolayout, what would be the proper way to display somthing above an UINavigationController?

In my app, i have a main view controller which sometimes brings a modal view on top of it. This modal view is a UINavigationController with a navigation bar. I want to display an image above the navigation bar, and have the navigation bar appear below the image.
I do not want to subclass anything and the app uses autolayout, i do not want a bunch of delegate callbacks and frame calculations. The view inside the navigation controller (the actual modal content) must still respond to different screen sizes correctly, such as rotation, call status bar etc. Also, no IB solutions please, these views are all managed in code.
How do i accomplish this?
I would turn off AutoLayout and place the image at the top
I don't think you can do it with your modal view being a navigation controller. I would do it by making that modal controller a UIViewController that you set up as a custom container controller. You can add an image view to the top of this controller's view and add the view of a child view controller (which would be a navigation controller) to the bottom. This would be a lot easier to do in a storyboard using container views, but it certainly can be done in code.

Custom navigation controller and navigation bar?

I am well aware of how to implement my own drawing of a navigation bar. What I want to active is something similar to the Jetsetter iPhone application. Which has a very nice animation when swapping between view controllers (in a similar way you would push/pop view controllers in a UINavigationController stack).
Would this require a complete rewrite of the UINavigationController or could I somehow just override some vital parts?
I would be great full for any information right now.
Thanks
In my opinion, they hide the navigation bar and roll their own view.
Please check this link.
On some views they are not using a navigation bar, they are just creating a simple view and adding buttons for popping and pushing, but on some views, they change the navigation bar background and initialize the backbarbutton and forward button items and title with their own views and then add gestures recognizers to these, its very simple.

Resources