     dismisser.dismissWhenGestureRecognizerBegins(pan)
   }
 }
+
+private final class ModalDialogPresentationController: UIPresentationController {
+
+  override var frameOfPresentedViewInContainerView: CGRect {
+    guard let containerView = containerView else {
+      assertionFailure("Missing container view during frame query.")
+      return .zero()
+    }
+    let size = CGSize(width: 200, height: 200)
+    return CGRect(x: containerView.bounds.midX - size.width / 2,
+                  y: containerView.bounds.midY - size.height / 2,
+                  width: size.width,
+                  height: size.height)
+  }
+}

  }
}

class ModalDialogTransition: SelfDismissingTransition {

  func willBeginTransition(withContext ctx: TransitionContext, runtime: MotionRuntime) -> [Stateful] {
    let size = ctx.fore.view.frame.size

    super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)

    transitionController.transition = ModalDialogTransition()
  }

  required init?(coder aDecoder: NSCoder) {
