EZSwipeController icon indicating copy to clipboard operation
EZSwipeController copied to clipboard

Turning EZSwipeController into a UINavigationController

Open gkuhlmann14 opened this issue 8 years ago • 2 comments

I ran into a problem with pushing and popping VC's in the EZSwipe hierarchy.

I've seen some suggestions on here with embedding the EZSwipe in a UINavigationController. I've tried that and it seems to not play nicely with the EZSwipe nav bar. What I think would be really nice is if we actually made the EZSwipe itself a nav controller, and make it smart enough to know which VC in the stack had a VC pushed to it, and we could ideally use the EZSwipe nav bar as the same nav bar used when pushing/popping to the navigation stack.

Lets take a 2 VC example where you have a profile (left) and a messages (right) VC. In your messages VC, you want to be able to click on a conversation with someone and simply push that conversation VC to the stack.

I've seen how the standard EZSwipe is:

app->ezswipe ezswipe->profileVC ezswipe->messagesVC

Also I've seen suggested if you want to push/pop VC's:

app->ezswipe ezswipe->profileVC ezswipe->navigation controller->messagesVC

The problem with this in my experience so far is that when you push/pop in the messages VC it doesnt play nicely with the EZswipe. For example, if you click on a message and push a conversation VC to your nav stack, the user will still be able to swipe right and navigate to the profile VC. In my opinion, if you swipe right you should dismiss the conversationVC and be back at the messagesVC (then swipe right again to get to your profileVC.

I'm playing around with it now, but what would the implications be if we actually made the EZSwipeController inherit from the UINavigationController class as opposed to a UIViewController class?

If we could make it so you can push/pop anywhere in the EZSwipe and the VC would know how to handle it.

gkuhlmann14 avatar Jun 04 '16 19:06 gkuhlmann14

https://github.com/goktugyil/EZSwipeController/issues/13

this might help out

Esqarrouth avatar Jun 04 '16 23:06 Esqarrouth

I saw that, but couldn't end up getting:

app->ezswipe ezswipe->profileVC ezswipe->navigation controller->messagesVC

to work nicely.

How I've got it going now, is I've put my EZSwipe VC in a nav controller. Then, in the standard swipe mode I use the EZswipe nav bar, and HIDE the navigation controller nav bar. Then when a user selects a message, I unhide the navigation controller nav bar and push my VC. This gives it the same feel of a nav, and since the EZswipe is contained in the nav, I end up getting the swipe right gesture to navigate back when I push/pop VC's which is nice.

It works alright, but still not as slick as I think it could be.

I tried making the EZswipe itself a nav controller and was seeing some wonky behaviour when pushing/popping and unfortunately need to ship tomorrow. I'll update this issue if I end up getting it working correctly.

gkuhlmann14 avatar Jun 05 '16 00:06 gkuhlmann14