Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to overlay a view on top of BOTH drawer and primary containers? #58

Closed
ivanmkc opened this issue Jul 23, 2017 · 4 comments
Closed

Comments

@ivanmkc
Copy link

ivanmkc commented Jul 23, 2017

Great work with Pulley!

I have a view that lies above both the primary and drawer container views in my Storyboard.

However, at run-time, the view appears underneath (in the view debugger) the containers, so I can't see them.

Is there any way to achieve this?

Thanks!

@amyleecodes
Copy link
Contributor

Sure. So, I want to start by mentioning that using Pulley in Storyboards is a bit of a hack. The view hierarchy in Storyboards doesn’t actually match what Pulley rebuilds internally, so I’m not surprised it doesn’t behave well in that circumstance.

But, there is a solution! You want to make a new view controller with a full screen container view, then use an embed segue with that container view to embed the Pulley View Controller that you have into that view controller. In that new parent view controller, you can put a view on top of the container view the Pulley VC is embedded in, and it should work properly.

If that wasn’t clear, let me know and I’ll make a quick sample project showing it.

Thanks!

@ShawnBaek
Copy link

@Brendan09 Could you sending or updating sample project?

@amyleecodes
Copy link
Contributor

amyleecodes commented Feb 7, 2018

Here is a zip file containing a sample project that does this: https://www.dropbox.com/s/hurzxag6tx64zbp/Pulley-Floating%20Content.zip?dl=0

It's done in the Storyboard, using a Container View in the new initial view controller I've added to the Storyboard. Anything 'above' the container view in that view controller will 'float' over the drawer and primary content view controllers. In this sample, it's a UILabel.

Be careful: Anything that is user interactive (for example a large UIView) will steal touches, even if it's transparent, unless you disable user interaction on the view. You obviously need user interaction enabled on controls, but I'd recommend disabling it on anything not essential.

Reminder: If you disable user interaction on a view containing controls then the controls will be disabled as well.

Let me know if you have any questions.

@ShawnBaek @ivanmkc

@ShawnBaek
Copy link

ShawnBaek commented Feb 8, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants