 
 extension UIViewController {
     public func present(_ viewController: UIViewController, limitedToMaxWidth maxWidth: CGFloat?, maxHeight: CGFloat?, animated: Bool = true) {
-        guard (maxWidth ?? 99999) < self.view.bounds.width
-            || (maxHeight ?? 99999) < self.view.bounds.height
+        let width = maxWidth ?? .greatestFiniteMagnitude
+        let height = maxHeight ?? .greatestFiniteMagnitude
+        guard width < self.view.bounds.width
+            || height < self.view.bounds.height
             else
         {
             self.present(viewController, animated: true, completion: nil)
             return
         }
-        let limited = LimitedSizeViewController(root: viewController, maxWidth: maxWidth, maxHeight: maxHeight)
+        let limited = LimitedSizeViewController(root: viewController, maxWidth: width, maxHeight: height)
         limited.modalPresentationStyle = .overCurrentContext
         self.present(limited, animated: animated)
     }

        self.containerView.backgroundColor = UIColor.clear
        self.view.addSubview(self.containerView)

        self.bottomConstraint = NSLayoutConstraint(bottomOf: self.containerView, to: self.view)
        self.keyboardConstraintAdjuster.constraint = self.bottomConstraint
        self.view.addConstraints([
            self.bottomConstraint,
            NSLayoutConstraint(item: self.containerView, attribute: .top, relatedBy: .equal, toItem: self.topLayoutGuide, attribute: .bottom, multiplier: 1, constant: 0),
            NSLayoutConstraint(leftOf: self.containerView, to: self.view),
            NSLayoutConstraint(rightOf: self.containerView, to: self.view),
        ])

        self.modalTransitionStyle = .crossDissolve

            NSLayoutConstraint(item: rootViewController.view, attribute: .top, relatedBy: .greaterThanOrEqual, toItem: self.containerView, attribute: .top, multiplier: 1, constant: 0),
            NSLayoutConstraint(item: rootViewController.view, attribute: .left, relatedBy: .greaterThanOrEqual, toItem: self.containerView, attribute: .left, multiplier: 1, constant: 0),
        ])

        let widthConstraint = NSLayoutConstraint(item: rootViewController.view, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: maxWidth)
        widthConstraint.priority = 750
        rootViewController.view.addConstraint(widthConstraint)
        let heightConstraint = NSLayoutConstraint(item: rootViewController.view, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: maxHeight)
        heightConstraint.priority = 750
        rootViewController.view.addConstraint(heightConstraint)
    }

    public override var preferredStatusBarStyle: UIStatusBarStyle {
