PullUpController
PullUpController copied to clipboard
Bottom elements don't move when closing
If you add some component in the bottom with constraints not being set to top (for example bottom, sides and constant size) you will get this.
Temporarily fixed by removing bottom constraints. UPD: I mean bottom constraints in your lib. UPD2: Doesn't fully solve the problem, because now transition animation can't get where elements must be.
I saw the video and I don't really understand what's going on. I guess your main view has a blue background and your popup view controller's view is white and then you've added another view (the yellow one) on top of everything, is that right? What's the problem?
Not quite. The yellow view is inside PullUpController and, obviously, it shouldn't behave as it does. Here is this project. Please, take a look. Drawers.zip
Ok, I've found a solution. The problem was the pull up controller's view bottom anchor is equal to the parent view bottom anchor and to match this constraint, when the view is dragged down (aka the top constraint's constant is increased), it shrinks.
Instead of bottomConstraint = parentView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
we could use bottomConstraint = parentView.bottomAnchor.constraint(lessThanOrEqualTo: view.bottomAnchor)
I need to check if this change causes some regression, if not, I'll commit the change.
@MarioIannotta I found a bug with this solution. Now animation causes PullUp to jump from the bottom and show some free space there. We've already experienced this problem before, if you remember.
UPD: This is second video on here: https://github.com/MarioIannotta/PullUpController/issues/33#issuecomment-433612645
@MarioIannotta the question is why do you use 3 constraints to specify a vertical position on the screen while 2 of them is enough - bottom and height for example?