   }
 
   override func size(forChildContentContainer container: UIContentContainer, withParentContainerSize parentSize: CGSize) -> CGSize {
-    return modalSize()
+    return modalSize
   }
 
   override func containerViewWillLayoutSubviews() {


private extension AnimatablePresentationController {

  func modalSize() -> CGSize {
    let containerSize = containerFrame.size
    let width = CGFloat(presentationConfiguration.modalSize.0.width(parentSize: containerSize))
    let height = CGFloat(presentationConfiguration.modalSize.1.height(parentSize: containerSize))
    return CGSize(width: width, height: height)
  }

  func modalCenter() -> CGPoint? {
    return presentationConfiguration.modalPosition.calculateCenter(containerBounds: containerFrame, modalSize: modalSize())
  }

  func modalOrigin() -> CGPoint? {
    return presentationConfiguration.modalPosition.calculateOrigin()
  }


    var presentedViewFrame = CGRect.zero
    let sizeForChildContentContainer = size(forChildContentContainer: presentedViewController, withParentContainerSize: containerBounds.size)
    let origin: CGPoint
    if let center = modalCenter {
      origin = calculateOrigin(center: center, size: sizeForChildContentContainer)
    } else {
      origin = modalOrigin ?? .zero
    }

    presentedViewFrame.size = sizeForChildContentContainer
