iOS view push transitions with visible next view - ios

I'm trying to achieve a view transition style, the one that you can see when you slide from the left side of the screen towards the middle if you're in a view that can go back. (find any app that has a back button somewhere, and just swipe from left to right starting from the edge of the screen).
The difference between this and a regular push transition is that you can see the next AND current views on the same screen and, as you slide (if you go slowly) you can really see the view and "play" with it. But right now what it does it simply quickly slide (with black on the back) and show the next view.
I'd like to be able to do that between some of my views and i have no idea how to achieve that. I'm just using a custom segue that goes left to right or right to left but that's pretty much it.
Any idea how to achieve that?

If you are using a UINavigationController and the pushViewController:animated method, then this should be the default functionality on iOS 7.0 and later. Your new UIViewController will be able to be "pulled back" by the user using a swipe right from the left of the screen.

Related

Changing the animation for unwind segue

My client wanted a navigation drawer (hamburger menu) on the top-left corner of the navigation bar (yes, they know it's not adherent to the iOS design principles, but they want regardless).
I have the hamburger setup as a custom icon with a segue that pushes to the menu viewcontroller (MenuViewController)
The problem was the client said it slid out from the right, and closes to the left (which is standard with Apple). They want to reverse it.
So I need to reverse both animations (slide in, and slide out)
To do the first part, I followed this, which worked perfectly:
iOS Segue - Left to Right -
So now after applying that custom code it slides in beautifully from the left.
But now I want the drawer to slide back to the left, but of course by default it goes to the right when I click the < navigation arrow on the top of MenuViewController.
Any ideas how I could go about reversing this? I was thinking custom unwind segue, but I don't actually HAVE a segue on the storyboard because this is just a back button being generated as a result of pushing the MenuViewController to the navigation stack.
My guess is to create some sort of override for unwind on the MenuViewController.swift file, but I haven't had success so far.
Could anyone point me in the right direction?
Thanks!

How to implement swipe views with CollectionView/TableView Controllers?

I am creating an app using Swift, and I'm still trying to figure out what the best configuration would be.
What I'd like to have is 3 screens (the left screen would have a side out panel) that users can access via the navigation bar menu or just by swiping left/right the screen for more accessibility.
I could easily create my TableViewControllers/CollectionViewController and the menu, but I'm struggling at making the screen able to detect users gestures at the same time, and I'm not sure whether I should use 3 View Controllers and then add the Collection View/Table View via the Storyboard, or directly use the CollectionViewController/TableViewController
I added a picture here describing what I'd like to accomplish:
Also, I wonder whether I should use storyboards or not for my project.
I know that's a lot of questions !
Any ideas please ?
Thank you very much and have a good day,
J.
You need to add 2 "swipe gesture recogniser"s to your middle screen(your second screen in your attached image) , and set one for identifying left swipe and another for right swipe. Create action methods for both in your view controller and add code accessing left screen and right screen in respective methods.
note - you need to drag "swipe gesture recogniser" to top bar of your view controller scene to add it.
You can use a scrollview as a container, put three ViewController in it.

iOS : Swipe Gesture Push in one ViewController?

I want to add two swipe gesture. I did the code, and it's running, my text in the viewcontroller change when i touch the screen.
BUT, i want to add a "effect" when the user wants to slide at the next (or the previous) news, because currently, i'm just changing the text.
i tried to add action in the storyboard, to add push on the swipe with the view.
It's running, but there are two problems :
The push, seems to have a problem, because, when i want to slide on the previous news, the push effect comes right to left. (and not left - right)
I can't only change the contents without touch the navigation bar ? (because when i slide, the navigation bar loose him title, etc..)
If I understood you correctly you might want to use a UIScrollView. This will give you a nice animation.
You need a UIScrollView and add two of your ViewControllers as subviews.
Here are links to some ScollView tutorials:
Are there any good UIScrollView Tutorials on the net?
Pushing on the navigation controller stack is to the right if you want to go back to opposite direction instead of pushing, you should pop like so: [self.navigationController popViewControllerAnimated:YES]; You could paste some code in your question :)

Page curl modal segue : leave bottom bar on screen

I develop an app for iOS 5+ with storyboards (and ARC). I have a view controller with no status bar, a top navigation bar, a map in the middle, and a bottom toolbar with a button at the bottom right. I've linked the button to a modal VC via a page curl segue.
My problem is I would like the page curl effect to apply only to the map (just as iOS 5's map), or at least not to the bottom toolbar, so I can present/dismiss the modal VC with the same button of the bottom bar (I want it to be persistent). Right now, I can present it by pressing the button, but the toolbar goes up halfway of the screen with the whole view. I can dismiss it by touching the upper-left side of the screen but it's not really user friendly.
I can add the toolbar to the modal view controller, but that doesn't look nice...
Any ideas ?
Thanks.
A quick thought for you as I stumbled on this while looking for something else, but I would consider:
Putting the top section of the screen within a container view, then presenting the modal view from that. It will leave the bottom (toolbar area) clear.
Alternatively, instead of using the standard segue you could implement your own page curl, and/or using some of the open source projects that demonstrate how to do this.
You probably solved this long ago but perhaps this helps someone :)

How to Display Small Grab Handle for Hidden UITableView on iPad

I have an iPad application with a SplitViewController. I am hiding the left hand navigation panel (UITableView). It can be viewed by swiping in from the left of the screen. I would like to display a little "grab tab" on the left when it is hidden to give the user a visual indication that there is something there that they can view. I am just not sure how to go about this. Can someone point me in the right direction?
Solution 1
Well, then you will have to put create a view in which your rootViewController(leftView) will reside along with a custom Button with the handle image and you can remove or hide the customButton when your root view is visible and show when your root view is not visible.
Also, you will have to give this view(customButton + leftview) as argument to your splitview during allocation.
Solution 2
You can simply add a customButton to the splitview at the left side and bring it to the front by using [parentview bringSubviewToFront:subview] when rootview is not visible and remove it when it is clicked or swiped according to your functionality.
Hope This Helps You.

Resources