John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 989 forks source link

SWRevealViewControllerSeguePushController not working with Unwind Segues #543

Open felipeferri opened 8 years ago

felipeferri commented 8 years ago

I have a sequence of views that are pushed on top of each other on a Navigation Controller. I would like to do two things with these views:

To open the Rear menu view from all of them; To be able to navigate back the stack using Unwind segues.

I found out that if I push view controllers on top of each other using regular push segues then the unwind segue works as expected, but then the self.revealViewController on each view controller is not set and the Menu can't be called using the revealToggle: selector.

If I change the push segues to subclasses of SWRevealViewControllerSeguePushController then the views are pushed on top of each other and the Menu can be called from any of them using the revealToggle. Unfortunately, the unwind segues stop working (I think this might be because the view controllers are stacked using addChild instead of pushViewController on the SWRevealViewController class).

Is there a way of working together with SWRevealViewController and Unwind Segues?

Below there is an example storyboard:

menu example

The first view controller is the navigation controller; the second is the SWRevealViewController; the three view controllers below navigate one to each other, and the third has an unwind segue to the first. The first and third controllers have buttons that open the menu.

As I stated before, if the segues between the bottom view controllers are regular push segues then the unwind segue works as expected; the menu button from the first view controller works (as it is connected directly to the SWRevealViewController), but the menu button from the third view controller doesn't.

Switching the segue types to SWRevealViewControllerSeguePushController makes the menu buttons from the first and third view controllers work correctly, but the unwind segue stops working.

felipeferri commented 8 years ago

Hi!

Placing the UINavigationController just after the SWRevealViewController did the trick.

Thank you so much for your prompt response and congratulations on your excellent work on SWRevealViewController.

Best regards,

Felipe

Em 27/01/2016, à(s) 10:17, iDevelopper notifications@github.com escreveu:

What about this?

https://www.dropbox.com/sh/eupul3ciwpuh822/AAA5RIf2-4d97Q085h3dZwcwa?dl=0 https://www.dropbox.com/sh/eupul3ciwpuh822/AAA5RIf2-4d97Q085h3dZwcwa?dl=0 — Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-175589863.

iDevelopper commented 8 years ago

https://www.dropbox.com/sh/5q4q91bs56apxuo/AAAoUcuw07rAsqVA9MoF-LH-a?dl=0

felipeferri commented 8 years ago

Oh, sorry to bother you again.

In fact, I need to have an UINavigationController before the SWRevealViewController.

When I placed the UINavigationController just after the SWRevealViewController the other navigation controller acts weird. When I have both navigation controllers the Menu button stops working on the third view controller and the unwind segue to the first view controller goes to the Login view controller instead.

I am sending you with this e-mail the test project I am using. The result I was expecting is this: clicking the menu button unwinds to the Login screen; clicking the First button in the third view controller unwinds to the first view controller; clicking the menu button in either the first or third view controllers opens the menu.

Thank you so much.

Felipe

Em 27/01/2016, à(s) 10:30, Felipe Ferri felipe.ferri@gmail.com escreveu:

Hi!

Placing the UINavigationController just after the SWRevealViewController did the trick.

Thank you so much for your prompt response and congratulations on your excellent work on SWRevealViewController.

Best regards,

Felipe

Em 27/01/2016, à(s) 10:17, iDevelopper <notifications@github.com mailto:notifications@github.com> escreveu:

What about this?

https://www.dropbox.com/sh/eupul3ciwpuh822/AAA5RIf2-4d97Q085h3dZwcwa?dl=0 https://www.dropbox.com/sh/eupul3ciwpuh822/AAA5RIf2-4d97Q085h3dZwcwa?dl=0 — Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-175589863.

iDevelopper commented 8 years ago

I would like to have a look but i can't find your project

felipeferri commented 8 years ago

Maybe your e-mail provider blocks .zip files? I changed the extension to .png. Please rename the attached file to .zip to find the project.

Thank you!

Felipe

On Jan 27, 2016, at 12:00 PM, iDevelopper notifications@github.com wrote:

I would like to have a look but i can't find your project

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-175641237.

iDevelopper commented 8 years ago

No, but if you want, send me a mail with your project at patrick.bodet4@wanadoo.fr

Regards

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b2c2d7f0deeacb2020abb093aae97b15dc88e2447292cf0000000112c0afda9 2a169ce07af1a61@reply.github.com> Date : mercredi 27 janvier 2016 17:18 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Maybe your e-mail provider blocks .zip files? I changed the extension to .png. Please rename the attached file to .zip to find the project.

Thank you!

Felipe

On Jan 27, 2016, at 12:00 PM, iDevelopper notifications@github.com wrote:

I would like to have a look but i can't find your project

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5641237.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-175719582 .

iDevelopper commented 8 years ago

Hello,

Do you want to send me your project? I don’t think we can do it via Github issues. Or you could post a repository with your account.

Regards,

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b2c2d7f0deeacb2020abb093aae97b15dc88e2447292cf0000000112c0afda9 2a169ce07af1a61@reply.github.com> Date : mercredi 27 janvier 2016 17:18 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Maybe your e-mail provider blocks .zip files? I changed the extension to .png. Please rename the attached file to .zip to find the project.

Thank you!

Felipe

On Jan 27, 2016, at 12:00 PM, iDevelopper notifications@github.com wrote:

I would like to have a look but i can't find your project

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5641237.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-175719582 .

felipeferri commented 8 years ago

Ok, I've put it on github: https://github.com/felipeferri/SWRevealAndSegues https://github.com/felipeferri/SWRevealAndSegues

Thanks,

Felipe

Em 27/01/2016, à(s) 14:32, iDevelopper notifications@github.com escreveu:

No, but if you want, send me a mail with your project at patrick.bodet4@wanadoo.fr

Regards

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b2c2d7f0deeacb2020abb093aae97b15dc88e2447292cf0000000112c0afda9 2a169ce07af1a61@reply.github.com> Date : mercredi 27 janvier 2016 17:18 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Maybe your e-mail provider blocks .zip files? I changed the extension to .png. Please rename the attached file to .zip to find the project.

Thank you!

Felipe

On Jan 27, 2016, at 12:00 PM, iDevelopper notifications@github.com wrote:

I would like to have a look but i can't find your project

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5641237.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-175719582 .

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-175728400.

iDevelopper commented 8 years ago

I’ve got it! The sample i sent you yesterday was good; I suppose your menu contains other things than login option. You could have a reference of your menuController and ask it to show login or logout if the user is already connected or not?

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b25cf137a72f8b0802413ee96eb09e3bd2524a0b7092cf0000000112c1f7369 2a169ce07af1a61@reply.github.com> Date : jeudi 28 janvier 2016 16:35 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Ok, I've put it on github: https://github.com/felipeferri/SWRevealAndSegues https://github.com/felipeferri/SWRevealAndSegues

Thanks,

Felipe

Em 27/01/2016, à(s) 14:32, iDevelopper notifications@github.com escreveu:

No, but if you want, send me a mail with your project at patrick.bodet4@wanadoo.fr

Regards

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b2c2d7f0deeacb2020abb093aae97b15dc88e2447292cf0000000112c0afda9 2a169ce07af1a61@reply.github.com> Date : mercredi 27 janvier 2016 17:18 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Maybe your e-mail provider blocks .zip files? I changed the extension to .png. Please rename the attached file to .zip to find the project.

Thank you!

Felipe

On Jan 27, 2016, at 12:00 PM, iDevelopper notifications@github.com wrote:

I would like to have a look but i can't find your project

— Reply to this email directly or view it on GitHub

https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5641237.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-175719582 .

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5728400.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-176238909 .

iDevelopper commented 8 years ago

Hello,

Is it what you want?

https://www.dropbox.com/s/atlb2yrfbdnlrpa/SWRevealAndSegues-master.zip?dl=0

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b25cf137a72f8b0802413ee96eb09e3bd2524a0b7092cf0000000112c1f7369 2a169ce07af1a61@reply.github.com> Date : jeudi 28 janvier 2016 16:35 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Ok, I've put it on github: https://github.com/felipeferri/SWRevealAndSegues https://github.com/felipeferri/SWRevealAndSegues

Thanks,

Felipe

Em 27/01/2016, à(s) 14:32, iDevelopper notifications@github.com escreveu:

No, but if you want, send me a mail with your project at patrick.bodet4@wanadoo.fr

Regards

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b2c2d7f0deeacb2020abb093aae97b15dc88e2447292cf0000000112c0afda9 2a169ce07af1a61@reply.github.com> Date : mercredi 27 janvier 2016 17:18 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Maybe your e-mail provider blocks .zip files? I changed the extension to .png. Please rename the attached file to .zip to find the project.

Thank you!

Felipe

On Jan 27, 2016, at 12:00 PM, iDevelopper notifications@github.com wrote:

I would like to have a look but i can't find your project

— Reply to this email directly or view it on GitHub

https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5641237.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-175719582 .

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5728400.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-176238909 .

felipeferri commented 8 years ago

Yes... It is working perfectly!

Thank you very much!

Your support was excellent.

Felipe

On Jan 29, 2016, at 5:37 AM, iDevelopper notifications@github.com wrote:

Hello,

Is it what you want?

https://www.dropbox.com/s/atlb2yrfbdnlrpa/SWRevealAndSegues-master.zip?dl=0

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b25cf137a72f8b0802413ee96eb09e3bd2524a0b7092cf0000000112c1f7369 2a169ce07af1a61@reply.github.com> Date : jeudi 28 janvier 2016 16:35 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Ok, I've put it on github: https://github.com/felipeferri/SWRevealAndSegues https://github.com/felipeferri/SWRevealAndSegues

Thanks,

Felipe

Em 27/01/2016, à(s) 14:32, iDevelopper notifications@github.com escreveu:

No, but if you want, send me a mail with your project at patrick.bodet4@wanadoo.fr

Regards

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b2c2d7f0deeacb2020abb093aae97b15dc88e2447292cf0000000112c0afda9 2a169ce07af1a61@reply.github.com> Date : mercredi 27 janvier 2016 17:18 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Maybe your e-mail provider blocks .zip files? I changed the extension to .png. Please rename the attached file to .zip to find the project.

Thank you!

Felipe

On Jan 27, 2016, at 12:00 PM, iDevelopper notifications@github.com wrote:

I would like to have a look but i can't find your project

— Reply to this email directly or view it on GitHub

https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5641237.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-175719582 .

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5728400.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-176238909 .

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-176622416.

felipeferri commented 8 years ago

Actually the case is that the app logs in automatically and the menu allows you to pop to the Login screen again.. Though I named the menu button "Login" it actually was a Logout button... :-)

On Jan 28, 2016, at 1:58 PM, iDevelopper notifications@github.com wrote:

I’ve got it! The sample i sent you yesterday was good; I suppose your menu contains other things than login option. You could have a reference of your menuController and ask it to show login or logout if the user is already connected or not?

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b25cf137a72f8b0802413ee96eb09e3bd2524a0b7092cf0000000112c1f7369 2a169ce07af1a61@reply.github.com> Date : jeudi 28 janvier 2016 16:35 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Ok, I've put it on github: https://github.com/felipeferri/SWRevealAndSegues https://github.com/felipeferri/SWRevealAndSegues

Thanks,

Felipe

Em 27/01/2016, à(s) 14:32, iDevelopper notifications@github.com escreveu:

No, but if you want, send me a mail with your project at patrick.bodet4@wanadoo.fr

Regards

Patrick BODET

De : felipeferri notifications@github.com Répondre à : John-Lluch/SWRevealViewController <reply+001b32b2c2d7f0deeacb2020abb093aae97b15dc88e2447292cf0000000112c0afda9 2a169ce07af1a61@reply.github.com> Date : mercredi 27 janvier 2016 17:18 À : John-Lluch/SWRevealViewController SWRevealViewController@noreply.github.com Cc : Patrick BODET patrick.bodet4@wanadoo.fr Objet : Re: [SWRevealViewController] SWRevealViewControllerSeguePushController not working with Unwind Segues (#543)

Maybe your e-mail provider blocks .zip files? I changed the extension to .png. Please rename the attached file to .zip to find the project.

Thank you!

Felipe

On Jan 27, 2016, at 12:00 PM, iDevelopper notifications@github.com wrote:

I would like to have a look but i can't find your project

— Reply to this email directly or view it on GitHub

https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5641237.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-175719582 .

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-17 5728400.

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecommen t-176238909 .

— Reply to this email directly or view it on GitHub https://github.com/John-Lluch/SWRevealViewController/issues/543#issuecomment-176247006.

iDevelopper commented 8 years ago

That's what I thought :)