             containedViewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
             buttonContainer.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
             buttonContainer.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
-            bottomConstraint,
+            buttonContainer.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
             ])
         containedViewController.didMove(toParent: self)
         buttonContainer.didMove(toParent: self)

    }
    
    func performAnimation(_ animation: Animation, animator: UIViewPropertyAnimator = UIViewPropertyAnimator(duration: 3, curve: .easeInOut, animations: nil)) {

        switch animation {
        case .hideBottomController:
            bottomConstraint.constant = buttonContainer.view.frame.height
        case .showBottomController:
            bottomConstraint.constant = 0
        case .custom(let spacing):
            bottomConstraint.constant = spacing
        }
        animator.addAnimations {
            self.view.layoutIfNeeded()
        }
        animator.startAnimation()
    }

        }
        addChild(buttonContainer)
        view.addAutolayoutSubview(buttonContainer.view)

        NSLayoutConstraint.activate([
            containedViewController.view.topAnchor.constraint(equalTo: view.topAnchor),
