Changing the animation for unwind segue - ios

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!

Related

Present View Controller with navigation bar without Segue

I am using google maps SDK. They have a neat feature where you press a UIButton to call the following method and a VC is presented from the right hand side to the left hand side just like how you would do with Segue. But the difference is that there was no segue or anything that I need to call myself and the google function does it automatically, The new VC also comes with navigation bar with back button. I noticed that the navigation bar is different to the one from previous VC and the back button is also different. I want to do the same for one of my current VC and by implementing a function that achieves the same effect (And I do not want to use segue for some reason that would be off topic here). I am thinking how google have done it might be
Possible solution? Present a newVC to with transition type from right to left and Allow that VC to have it's own navigation bar (Or perhaps that might just be a UIView with back button (I am not sure). However, that VC needs to be able to be dismissed either by pressing back button or dragging the screen from left edge to right (And is also able to be held half way like the image below). And the dismiss transition type when back button is pressed is from left to right just like normal navigation Bar dismiss Segue.
self.placePicker?.pickPlaceWithCallback({ (place: GMSPlace?, error: NSError?) -> Void in
google place sdk image

XCode 7 Storyboard segue usage confusion

I'm trying to make segue using storyboard, and I found it's really confusing for me. Sometimes, when I drag and drop segue push or modal, both will act like modal (bottom to up). And sometimes, it will act like push (right to left). I'm also using navigation controller to handle the right and left button. Do you know why it happens? How do we make sure that if we want to View Controller to animate right and left, we use push. and if we want to use modal, the View Controller to animate bottom to top. Thank you guys!
Check you are using the correct type of segue -->
On the right hand side, after selecting the segue -->

iOS view push transitions with visible next view

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.

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 :)

Tabbar not showing in ios application

i am making one iOS tabbar application in that i have put 4 different tabs and whenever i click on 1 st tab and load another view after clicking of the first tab. After that when i press back button then tabbar is not displaying .So that i want hint that how can i show that
back the tabbar when we move from one tab from another and yes how i can use consistent the tabbar in whole application can you just guys help me on this i am new to iOS development.
here i am put the screen shot ...
here first screen is this one..
when i tap the video button that are first in the view then another window open
which are as under and see the tabbar is not there...
when in video controller there is tabbar is there but i drag and connect to that then tabbar is disabled
Looking at your screen snapshots, do I correctly assume you're attempting to transition to the "Videos" scene by touching the big "Videos" button in the center of the "Home" scene (rather than touching the tab bar button at the bottom of the screen, which I assume works fine)? If that's the case, you need to have your button tell the view controller's tab bar controller that you want to change the index of the tab bar, and it takes care of it for you. You cannot do the transition using a segue (or at least not without a custom segue, which is even more complicated than the procedure I outline below). If you're changing the view some other way (e.g. using a standard segue or using presentViewController, pushViewController programmatically, etc.), your tab bar can disappear on you.
You later said:
when in video controller there is tabbar is there but i drag and connect to that then tabbar is disabled
Yes, that's true. You cannot use a segue from one of your big buttons to one of the tabs in your tab bar. (Or technically, if you wanted to use a segue, it would be a custom segue which would do something very much like my below code, though perhaps a tad more complicated.) So, rather than using a segue for your big button, you need to write an IBAction (connected to the big Videos button on the Home scene), that tells the tab bar to change its selection:
- (IBAction)clickedVideosButton:(id)sender
{
[self.tabBarController setSelectedIndex:1];
}
A couple of comments:
My answer was predicated on the assumption that your tab bar works as expected when you tap on the buttons of the tab bar, itself. If you tap the buttons at the bottom of the screen, do you transition to your other views correctly and preserve the tab bar? If so, my answer above should solve your issues in getting the big buttons to work. If not, though, then the problem rests elsewhere and you need to show us your code that might account for that (either you're something non-standard in the UITabBarControllerDelegate methods, or your viewDidLoad of the view is doing something nonstandard).
If I understand your user interface design right, you have the tab bar at the bottom as well as the big buttons in the middle, which presumably do the same thing. That is, no offense, a curious user interface design (duplicative buttons, requiring extra tap on a button, etc.). You might want to choose to either use either big buttons (in which you can retire the tab bar, eliminate the IBAction code I've provided above, and just use a nice simple navigation controller and push segues, for example), or just use the tab bar (and lose the home screen, lose the big buttons, etc.).
You also made reference to "press back button", and I don't see any "back" button on any of your screen snapshots. Do I infer that you have a navigation controller and you're doing a pushViewController or push segue somewhere? If you're doing something with back buttons, you might need to clarify your question further.

Resources