     }
 
     private var _observingInsets = false
+    private var _shouldObserveInsets: Bool {
+        guard let viewControllerClass = viewControllerClass else {
+            return false
+        }
+        return !(viewControllerClass is UITabBarController.Type) &&
+            !(viewControllerClass is UINavigationController.Type)
+    }
     private func _stopObservingInsets() {
         if #available(iOS 11.0, *), _observingInsets {
             removeObserver(self, forKeyPath: "_view.safeAreaInsets")

        change: [NSKeyValueChangeKey: Any]?,
        context _: UnsafeMutableRawPointer?
    ) {
        guard let change = change, _setupComplete, !_suppressUpdates else {
            return
        }
        if let new = change[.newKey] as? CGRect {
            if !new.size.isNearlyEqual(to: frame.size) {
                var root = self
                while let parent = root.parent {
                    root = parent

        guard _suppressUpdates == false, let _view = _view else { return }
        defer { _suppressUpdates = false }
        _suppressUpdates = true
        let frame = self.frame
        if frame != _view.frame {
            if _view.translatesAutoresizingMaskIntoConstraints {
                let transform = _view.layer.transform
                _view.layer.transform = CATransform3DIdentity
                _view.frame = frame
                _view.layer.transform = transform
            } else if let _widthConstraint = _widthConstraint, let _heightConstraint = _heightConstraint {
                setUpConstraints()
                _widthConstraint.constant = frame.width
                _widthConstraint.isActive = true
                _heightConstraint.constant = frame.height
                _heightConstraint.isActive = true
            }
        }
        for child in children {
            try LayoutError.wrap(child.updateFrame, for: self)
