 
 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)
     }

            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),
        ])
        if let maxWidth = maxWidth {
            let constraint = NSLayoutConstraint(item: rootViewController.view, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: maxWidth)
            constraint.priority = 750
            rootViewController.view.addConstraint(constraint)
        }
        if let maxHeight = maxHeight {
            let constraint = NSLayoutConstraint(item: rootViewController.view, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: maxHeight)
            constraint.priority = 750
            rootViewController.view.addConstraint(constraint)
        }
    }

    public override var preferredStatusBarStyle: UIStatusBarStyle {


    @available(*, deprecated, message: "Use extension on UIViewController instead")
    public convenience init(rootViewController: UIViewController, maxWidth: CGFloat?, maxHeight: CGFloat?) {
        self.init(root: rootViewController, maxWidth: maxWidth ?? .greatestFiniteMagnitude, maxHeight: maxHeight ?? .greatestFiniteMagnitude)
    }

    fileprivate init(root: UIViewController, maxWidth: CGFloat, maxHeight: CGFloat) {
        self.maxWidth = maxWidth
        self.maxHeight = maxHeight
        self.rootViewController = root
