         else {
             rootViewController.view.clipsToBounds = false
             rootViewController.view.layer.cornerRadius = 0
-
         }
     }
 }
+
+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
+            else
+        {
+            self.present(viewController, animated: true, completion: nil)
+            return
+        }
+        let limited = LimitedSizeViewController(root: viewController, maxWidth: maxWidth, maxHeight: maxHeight)
+        limited.modalPresentationStyle = .overCurrentContext
+        self.present(limited, animated: animated)
+    }
+}
+
 #endif

        self.keyboardConstraintAdjuster.constraint = self.bottomConstraint
        self.view.addConstraints([
            self.bottomConstraint,
            NSLayoutConstraint(topOf: self.containerView, to: self.view),
            NSLayoutConstraint(leftOf: self.containerView, to: self.view),
            NSLayoutConstraint(rightOf: self.containerView, to: self.view),
        ])

        self.modalPresentationStyle = .overCurrentContext
        self.modalTransitionStyle = .crossDissolve

        self.addChildViewController(rootViewController)

            rootViewController.view.addConstraint(constraint)
        }
    }

    public override var preferredStatusBarStyle: UIStatusBarStyle {
        if (self.maxWidth ?? 99999) < self.view.bounds.width
            || (self.maxHeight ?? 99999) < self.view.bounds.height
        {
            return self.parent?.preferredStatusBarStyle ?? .lightContent
        }
        return self.rootViewController.preferredStatusBarStyle
    }
    
    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
