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

Get ViewController of sw_rear? #612

Closed Dbigshooter closed 8 years ago

Dbigshooter commented 8 years ago

Hi there!

My problem seems fairly simple, but I just can't figure out how to solve it. When my MenuViewController is showing, it's the rear one, I need to set a delegate in the MenuViewController so I can modify the content in the ViewController I came from. For instance I have a button in the MenuViewController which is meant to modify the map in the ViewController I am showing the MenuViewController from. Any suggestions? Really appreciated!

iDevelopper commented 8 years ago

Yes.

Example3Swift.zip

You have some properties to set the shadow:

/**

/**

/**

/**

The same for left and right views when above.

2016-08-23_17-01-11

Dbigshooter commented 8 years ago

Where do I find those properties?

iDevelopper commented 8 years ago

All those properties are in PBRevealViewController.h and also documented on cocoa pods.

Dbigshooter commented 8 years ago

Oh okay, I can use different styles for the left and right menu? Your example gives me this error: linker command failed with exit code 1 (use -v to see invocation)

I cannot get the push to work. On my static cell I've made a custom segue with PBRevealViewControllerSeguePushController, but it doesn't work.

iDevelopper commented 8 years ago

Yes. On top or none, Custom shadow for each, overdraw, displacement etc...

Dbigshooter commented 8 years ago

How can I make the menu push the main view, and not go on top of it?

iDevelopper commented 8 years ago

This is the case of these last two images, no? The menu is not on top, there a just in this sample a blur effect on the table view.

Dbigshooter commented 8 years ago

At the moment the view covers something of my maincontroller, I don't want it to do that, I just want to push it to the right.

iDevelopper commented 8 years ago

Is it a test project you can provide here? Then I could see.

Dbigshooter commented 8 years ago

In your example, you can still see the menubutton on the maincontroller, my left menucontroller covers that at the moment, and I don't want it to. I want it to show exactly like SWRevealViewController

iDevelopper commented 8 years ago

Did you set LeftViewPresentOnTop to false? A property in PBRevealViewController.h

Dbigshooter commented 8 years ago

Perfect, thanks! I really appreciate your taking time to guide me! Can you answer this, since it find it really odd.

I cannot get the push to work. On my static cell I've made a custom segue with PBRevealViewControllerSeguePushController, but it doesn't work.

Dbigshooter commented 8 years ago

Can I somehow change the height of the right menu? I don't want it to start at the top on the screen, but just below the navigationbar.

iDevelopper commented 8 years ago

I have no sample with static cell, i never use that. Can you post your sample please?

For the second question, use the:

/**

Dbigshooter commented 8 years ago

I can't get it to work by setting that to YES, nothing happens?

I'll post an samle in a minute.

iDevelopper commented 8 years ago

OK and in my sample, the right menu is under the navigation bar. But in this case it must be presented on top on the main view because if not the navigation bar of the main view is pushed on left!

Dbigshooter commented 8 years ago

I tried to edit it in the .m file, but it is still covering the navigationbar.

iDevelopper commented 8 years ago
        self.revealViewController()?.rightPresentViewHierarchically = true
Dbigshooter commented 8 years ago

It worked, thanks! I'll post a sample with static cells, I really want to use that.

Dbigshooter commented 8 years ago

Uhm, but there's not much to show with the static cells, you just drag a segue from the menupoint to the controller you want to go to. But unfortunately it doesn't work.

iDevelopper commented 8 years ago

I have already test but with dynamic cells (table view cell -> push segue and test the indexPath). I have to write a sample if you can't send your with static cells. Why do you want to use static cells? Is it from rightViewController?

Dbigshooter commented 8 years ago

I got it to work ;o) Is it possible to make the right view controller a bit transparent?

iDevelopper commented 8 years ago

Cool! Those are your controllers, you do what you want with. PBRevealViewController just present them. In my sample, the right view controller is transparent and the left one have a blur effect. Play with your view's alpha property.

Dbigshooter commented 8 years ago

Thanks! Is it possible to reduce the height of the rightview? I want it to be a little short at the bottom, so I can fit in a tabbar.

iDevelopper commented 8 years ago

Hi,

In my sample, there is a tab bar controller (see storyboard). It is automatic...

Dbigshooter commented 8 years ago

@iDevelopper For some reason I can't run your example, I get:

linker command failed with exit code 1 (use -v to see invocation)

iDevelopper commented 8 years ago

Did you not run it yesterday?

iDevelopper commented 8 years ago

You must open the xcworkspace and not the xcodeproj.

Dbigshooter commented 8 years ago

Got it solved. However I can see that your right menu is behind the tabBar, I actually want the view to stop by the tabBar. Is that possible?

iDevelopper commented 8 years ago

It is not! This is a table view controller. This controller takes all the screen by default. But you can see that all the cells are visibles when scrolling. If you want to do differently, uses a UIViewController with a table view. Don't forget to set the datasource and delegate of table view to it.

iDevelopper commented 8 years ago

I would like you to open issues in the PBRevealViewController's Github repository as this is not the right place here now! Thanks a lot!