Swipe view controller with gesture - ios

I want to create an interaction between two view controller.
The first view controller has a button with the action to show the second view controller from the bottom to half of his height.
From there i can dismiss the second view controller, from first view controller underneath it, by using the swipe gestures slide up (full screen) and slide down (dismiss).
For example: the same interaction in Google Maps app when long pressed a point on the map. First the second view controller is shown over the map view controller than with swipe gesture you can dismiss or changed in full screen the second view controller's appearance.

Related

How can i load a new view controller partially on top of the existing view controller?

The goal is to achieve exactly the same effect as creating a new email message in the the Mail app on iOS.
When clicking on the "Compose" button at the right bottom corner of the Mail app, the present view controller fades slightly in the background and a new view controller is loaded partially on top of it. The old view controller can be still perceived at the top of the screen. The Fantastical app does it as well when clicking on the "+" button at the top right corner.
You can add it into your current view controller as a child view controller.
// Parent View Controller
//...
let childController = ChildController()
addChildViewController(childController)
// add the child controller's view in, reframe it, animate it here
addSubview(childController.view)
// To remove the controller
childController.removeFromParentViewController()

iOS: Slide in view created in storyboard

I don't know how to do this. I have a view created in Storyboard containing a picker wheel and slightly below a button.
Now if the user clicks a button in my view controller I want this "view container" slided in from the top and as soon as this button (within this view container) is clicked, the view should slide out to the top again. But how can I do this? As said I created this view container completely in my storyboard over my main view controller but don't know how to program this and also not what to do with the vertical constraints?
You want this view to be managed by a view controller. When the button is tapped, you call the view controller with a down animation. When the button under the picker wheel is tapped, you dismiss the view controller with a top animation.

iOS - UIButton on UIPageControl not working

I am using UIPageControl as indicator between different page (view controllers) of my application. In each of the view controllers, I need to have a different button on the left corner on the UIPageControl. If I place a UIButton at that position on each of the view controllers, I see it on the UIPageControl but the buttons do not respond to the touch event. Is there something I am missing? Or is there an alternative to do this? Thanks.
I guess the page control and the view controller view are both subviews of the same view. In this case, the button is drawn outside of the view controllers view bounds. This is allowed by default, but it does have the side effect that the button can't be tapped on as the superview doesn't handle the touch.
You should have the buttons on the page control owned by the 'super' view controller (the controller that owns the root view containing the page control and the child view controllers). Then, when a button is tapped it should tell the child view controller about it so that it can take the appropriate action.

Place button outside Modal View Controller

I would like to add a close button outside the bounds of the modal view controller which I am presenting on an iPad app.
I tried adding a button normally via storyboard, via coding, but the UIButtons view gets clipped by the bounds of the modal view controller.
What my purpose is : I want to add a close button at the right corner of my modal view controller which is configured as a Form sheet.
I'm launching the modal view controller via a segue from my previous view.
Attached screenshot show what I am trying to achieve:

No Animation when going back from detail view to table view, using navigation controller

I am building an app based on storyboard, navigation controller and tableview controllers.
When a user taps on a table cell a detail view is pushed in animated. So far so good.
My problem is that, when the user taps the back button on the Navigation bar, the table view appears with NO Animation.

Resources