John-Lluch / SWRevealViewController

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

i have some question #666

Open ttoggaiman opened 7 years ago

ttoggaiman commented 7 years ago

navigation

  1. i am using setfront method to change front view.. but if i change viewcontroller1 from viewconroller24 .. memory leak happen! my method is below self.revealViewController().setFront(vc, animated: true) so i have changed setfont moethod to pushFrontViewController(vc, animated: true) but always memory leak happen

  2. slide menu connected by navigation controller to first view controller(ex viewcontroller1,viewcontroller3)

but if i want to navigate viewcontroller1 -> viewcontroller2 or viewcontroller3->viewcontroller24 i 'am using show segue but.. is it correct? if my position viewcontroller24 but i want to change viewcontroller1 .. i use setfront ... but memory leak happen!

iDevelopper commented 7 years ago

What are the leaked objects? Can you show a bit of code? You can't use SWRevealViewControllerSeguePushController in storyboard and pushFrontViewController in code. It is one or the other.

ttoggaiman commented 7 years ago

show viewcontroller2 from viewcontroller1 let vc = self.storyboard?.instantiateViewController(withIdentifier: "viewcontroller2") self.navigationController?.pushViewController(vc!, animated: true)

back viewcontroller1 from viewcontroller2

let vc = self.storyboard?.instantiateViewController(withIdentifier: "viewcontroller1") self.revealViewController().setFront(vc, animated: true)

our code works perfectly but if go back viewcontroller1 from viewcontroller2 memory leak happen

manuelpaulo commented 7 years ago

Exact same problem here! Any idea of a fix? Thanks a lot.

iDevelopper commented 7 years ago

You don't have to instantiate viewcontroller1 to go back to it. Is is already in the navigation controller's stack as you pushed you push viewcontroller2 from it. To come back to viewcontroller1 just use the function:

func popViewController(animated: Bool) -> UIViewController?

LuAndreCast commented 7 years ago

How would you recommend dealing with multiple storyboards? should one use the storyboard segue or just push to the Viewcontroller (initial VC of the storyboard) ?

iDevelopper commented 7 years ago

Could you elaborate please. I don't understand the question. What do you want to exactly?

LuAndreCast commented 7 years ago

@iDevelopper never mind sir, figure it out and it was not related to SWRevealViewController. thank you :)

manuelpaulo commented 7 years ago

Thanks for the help @iDevelopper.

In my case, I want to add a custom UIView to the top app ViewControllers Hierarchy, that is always visible and always on top of everything.

I added some customUI to the presentedViewController SWRevealViewController, but the view didn't add.

Any idea on how to do it?

Also looks like I am having a memory leak on the ViewControllers Hierarchy, not sure if due to the SWRevealViewController. After leaks, stack of controllers increases.

iDevelopper commented 7 years ago

@manuelpaulo , Not sure I understand the question Could you provide a chart?