             requiredContentInset.right = currentContentInset.right
             
             // ensure scroll view is either at top or full height before doing automatic insetting
-            if requiredContentInset.top > 0.0 {
-                guard scrollView.frame.minY == 0.0 else { continue }
-            }
-            if requiredContentInset.bottom > 0.0 {
-                guard let scrollViewSuperview = scrollView.superview, scrollViewSuperview.bounds.maxY - scrollView.frame.maxY == 0.0 else { continue }
+            var isValidLayout = true
+            checkIsNotEmbeddedViewController(childViewController, {
+                if requiredContentInset.top > 0.0 {
+                    isValidLayout = scrollView.frame.minY == 0.0
+                }
+                if requiredContentInset.bottom > 0.0 {
+                    guard let scrollViewSuperview = scrollView.superview else {
+                        return
+                    }
+                    isValidLayout = (scrollViewSuperview.bounds.maxY - scrollView.frame.maxY) == 0.0
+                }
+            })
+            
+            guard isValidLayout else {
+                continue
             }
             
             // dont update if we dont need to
             if scrollView.contentInset != requiredContentInset {
-                
+            
                 scrollView.contentInset = requiredContentInset
                 scrollView.scrollIndicatorInsets = requiredContentInset
                 

                contentOffset.y = -requiredContentInset.top
                scrollView.contentOffset = contentOffset
            }
        }
    }
}

        var scrollViews = [UIScrollView?]()
        if let tableViewController = childViewController as? UITableViewController { // UITableViewController
            scrollViews.append(tableViewController.tableView)
        } else if let collectionViewController = childViewController as? UICollectionViewController { // UICollectionViewController
            scrollViews.append(collectionViewController.collectionView)
        } else if let subviews = childViewController.view?.subviews { // standard subview filtering
            scrollViews.append(contentsOf: subviews.map({ $0 as? UIScrollView }))
        }
