         let bottom = view.safeAreaBottom
         containerView.addSubview(tableView)
         tableView.frame = CGRect(x: 0, y: top, width: view.frame.width, height: view.frame.height - top - bottom)
+        
+        tableView.addObserver(self,
+                              forKeyPath: "contentSize",
+                              options: .new,
+                              context: nil)
 
         view.addSubview(topScrollView)
         topScrollView.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height)
-        topScrollView.contentSize = CGSize(width: view.frame.width, height: 4400 + top * 2 - stickyHeight + bottom)
         let scrollviewOrigin = topScrollView.frame.origin;
         topScrollView.scrollIndicatorInsets = UIEdgeInsets(top: -scrollviewOrigin.y, left: 0, bottom: scrollviewOrigin.y, right: scrollviewOrigin.x)
 

            containerView.bounds.origin.y = stickyHeight
        }
    }
}

extension NestedScrollViewVC: UITableViewDataSource {

    // https://stackoverflow.com/questions/13221488/uiscrollview-within-a-uiscrollview-how-to-keep-a-smooth-transition-when-scrolli
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.addGestureRecognizer(tableView.panGestureRecognizer)
        tableView.removeGestureRecognizer(tableView.panGestureRecognizer)
