mkko / DrawerView

A drop-in view, to be used as a drawer anywhere in your app
MIT License
376 stars 58 forks source link

Attach drawer below specific view #29

Open denandreychuk opened 4 years ago

denandreychuk commented 4 years ago

Hello @mkko! I have a question. Is it possible to insert drawer below specific view?

I have UITabBarController with some items inside it. I want to present drawer below UITabBar but on front of my UIViewControllers.

mkko commented 4 years ago

Hi! DrawerView acts like an ordinary view, so would it be possible to reorder view hierarchy and put it behind the tab bar? I haven't played with tab bar much, so I can't say from the top of my head.

denandreychuk commented 4 years ago

We only have bringSubviewToFront and sendSubviewToBack. But I need to insert drawer at specific position (insertSubview(_:belowSubview:)).

I think it would be nice, if DrawerView will allows us to manually insert it into view hierarchy and then just call some type of setup method to configure all internal constraints and other stuff. attachTo not flexible enough.

mkko commented 4 years ago

Would it work for you if there's overload for attachTo to specify the order in a more flexible way? Something like attachTo(view: UIView, belowSubview: UIView? = nil)?

denandreychuk commented 4 years ago

Yes, it should work.