-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Allow panel to be added to a subview of the view controller #40
Conversation
instead of the root view of the vc
Thank you for your PR and contribution😆 I'm glad them 👍 I reviewed your PR and considered what is best. In conclusion, I can't merge it to master because I think it's better to resolve the container issue on the user side. Instead of this change to this library, you can use a floating panel by defining a view controller for a container view. It's easy and make this library clear and simple. Here is a patch for the solution sample. And this PR has some problems.
I wouldn't like to drop the iOS10 support for now because it's possible. I hope you would accept my decision. Finally, I really appreciate your contribution. Thanks again. |
I'm sorry, I can't get the patch to apply cleanly. Can you post a full tarball link or push a branch? |
OK, managed to construct it manually. This solution works but unfortunately it has significant consequences regarding the view controller containment structure. I have a master view controller with the toolbar and a bunch of other child view controllers (let's call them "ABC") managing certain parts of the view. With your proposed solution, I have to move all "ABC" child view controllers one level deeper as subVCs of the panelContainerVC in order to be able to attach the panel to the root view of the panelContainerVC. Before:
After:
This is certainly doable but it strikes me as odd to move all content VCs one VC level deeper just because I add a panel to the rootVC. |
Could you apply the above patch to the master EDIT I'm sorry I found a storyboard problem in the above patch. please use this fixed patch. |
By the way, why not add the floating panel directly to the root VC? |
Can you please advise how to apply the patch? I checked out master (72f5d59) and tried like this:
|
Tried to apply the patch using manual edits. It seems to work, only the bottom inset of the content scrollview is not adjusted correctly. Looking at the code, it seems like |
Could you try the following commands?
You can set |
Allow panel to be added to a subview of the view controller instead of the root view of the vc.
I added an optional
containerView
parameter to theaddPanel
func. If set, the panel is added to that containerView instead ofviewController.view
.The sample app was updated to showcase the feature, using a containerView that is placed above a toolBar.
This requires iOS 11+ because safeAreaInsets aren't available on the view level in older iOS versions.