Custom segue from left to right for form sheets (iPad) - ios

I have some view controllers in a form sheet and right now they all push segue. But I want to make an animation that makes them come from right to left during segue throughout the page. so when I go to the next view controller my segue should start bringing the view controller from the right and the parent view controller starts to move to the left and goes off the screen/fades and the child view controller comes from right and settles at the center of the iPad like how form sheets do. I was wondering if anyone had implemented something like that before? if not, can I get some suggestions in how to do this so that I can get a head start? I have just have a little experience with custom segues, where I could use QuartzCore to animate the view controllers and since they all belong to the same navigation controller I am not sure how can I achieve this fly from right to center and to left animation.

You can create your own full-sized view controller and emulate form sheet's behavior inside it by yourself (with gesture recognizers etc)

Related

how to manage view controllers in a sequential pattern - swift

I'm trying to implement sth like images below. there are some views that should be displayed in a sequential order and a bar above them shows the flow of tasks.
as it is shown, first profile view should be displayed. when the user clicks on Go to Next View Button second view (price view) should be displayed. the top bar shows the current view where we are in it. I've tried PagingMenuController already to create a menu with views and then disable scrolling. but PagingMenuController loads all views at the same time and also i don't know how to go to next menu item within child views. now I'm thinking of a container view might be helpful but i didn't use container view so far and i don't know it's good for my purpose or not.
also i want that top bar without swiping between views (only on buttons) and one enable view at the same time.
any helps would be apprectiated.
Your question is both broad and vague. My answer is also going to be fairly high level. I suggest you follow my outline, and if you get stuck on a particular step, post your code, tell us about the problem you're having, and we can help you fix it.
This is pretty simple. Create custom view controller. Give it a container view at the bottom that would contain the current child view controller. Use view controller transition methods to switch between child view controllers. You'll want to add layout anchors to each new child view controllers to pin all of it's view's edges to the edges of the container view.
Create a custom control on top to show the dot and highlight the title of the current view controller.
If you want the next/previous buttons to be on the child view controllers, put them there, and add a delegate property to all the child view controllers that points to the parent view controller, with next and previous methods.
BTW, in languages, like English, where text is laid out from left to right, I would think your first page would be on the left and the last page would be on the right. (I think it makes more sense for profile to be on the left and pay on the right.)

For swift iOS app dev, how do I segue to a view that takes up part of the screen only?

GroupMe is a good example. I want to implement something similar to this..
when you press the top left icon it'll bring you to the view on the left hand side, and when you click the right hand side of that view (the chats) it will bring you back
As the documentation says:
Use segues to define the flow of your app’s interface. A segue defines
a transition between two view controllers in your app’s storyboard
file. The starting point of a segue is the button, table row, or
gesture recognizer that initiates the segue. The end point of a segue
is the view controller you want to display. A segue always presents a
new view controller, but you can also use an unwind segue to dismiss a
view controller.
As said by Apple© segues are for changing View Controllers only and cannot be used to move single views. I suggest using animations to achieve the effect you are searching, however segues are definitely not what you are looking for. Maybe this question on stackoverflow.com may help you.
And please be sure to check for information by yourself first, I got this information in less than 5 minutes by searching on Google.com.
Regards -Jorge

Transition of a view controller embedded in a navigation controller

I have a problem with a transition. I am modifying this project https://github.com/xxxAIRINxxx/MusicPlayerTransition in order to have the transition from the right instead of the bottom. This part is fine. My transition comes from the right.
My problem is that I'm embedding the presented modal view controller into a Navigation Controller. I do this so I can use the "pushViewController" function when I click on a cell of my modal view controller.
My hierarchy is as follow. I have a dashboard. From the right, I drag a TableViewController X. If I drag back in the opposite direction, I come back to my dashboard. Fine. Now, If I tap a cell, it pushes a new ViewController Y.
Now, if I am in my new ViewController Y and that I drag back, I come back directly on my dashboard instead of going back to my TableViewController X, as a natural navigation controller should behave.
I did a small project on github that does only that, so you can easily see my entire code.
https://github.com/magohamote/NavigationControllerTransition.git
I understand why it behaves like this, but I would like to know how I can override the transition set on the navigation controller in order to have the normal behaviour of my navigation controller once it is presented.
Another problem I have not been able to solve. On the project I used as a starter (the one from xxxAIRINxxx) the transition is perfectly smooth. On mine, the first time I trigger the transition, it blinks and get stuck. Once I did it once, it is smooth the next time I drag my view. But the first time is always awful. I don't know why either :(
Thank you a lot for your help!

Drag Back to Previous View Controller

When I push a new view controller in my app, I can pan from the very leftmost side of the screen and drag the view off (to the right) so that I'm back at the parent view controller. The motion follows my finger; I can drag it halfway and then back to the left if I want. This is built in.
I'm wanting to extend this functionality to the entire view. I want to be able to drag right from the center of the view and have it 'segue' back to the previous view controller, but not go all the way until my finger is released. It doesn't seem like a swipe gesture recognizer is what I want because that will segue all in one action. I have done some searching but I don't think I should have to implement a page view controller or a scroll view since similar functionality already exists.
What can I do to either modify the existing drag functionality or add a new gesture recognizer to accomplish this?

How to make swipe between Controllers with animation?

I have my structure like
Controller 1 <-> Controller 2 <-> Controller 3 <-> ...<->Controller N
I need to be able to access to controller 1 or 3 directly from another controllers. I need swipe animation between controllers 1-n , and navigation bar with < and > buttons.
What is the best solution for this swiping controllers? I need be able to do some animation there. Do i need use paged UIScrollView? or UIPageViewController? With animation - CALayer transition?
Please, help me to choose.
Hello #Alexander and anyone else who needs a solution to this problem,
I think the easiest way to deal with this situation would be to use the UIGestures which will give great animations and will simply be justified using the storyboard. To use it from one view controller to the other, just do the following:
If your side view is open, this will show up on the bottom right side of the storyboard:
Then, you will have to drag the swipe gesture recognizer to the initial view controller and then let go when the whole view is highlighted in blue:
After that, you will have to control-drag the gesture icon on the top of the initial view controller to the controller you want to connect to. Then it will show a drop down list after you let go of the highlighted controller. Pick any segue:
You can do this with all the view controllers by creating more gestures and segues. You can also do it from the same view controller back or even skip controllers with different types of gesture recognizers.
I hoped it helped :)

Resources