   
   public override func viewWillAppear(_ animated: Bool) {
     super.viewWillAppear(animated)
-    view.layoutIfNeeded()
     manager.viewWillAppear(animated)
   }
   

  public private(set) lazy var scrollView: UIScrollView = {
    let scrollView = UIScrollView()
    scrollView.isPagingEnabled = true
    scrollView.scrollsToTop = false
    scrollView.bounces = true
    scrollView.showsHorizontalScrollIndicator = false
    scrollView.showsVerticalScrollIndicator = false
    return scrollView

    }
  }
  
  public override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews()
    scrollView.frame = view.bounds
  }

  func layoutViews(for viewControllers: [UIViewController], keepContentOffset: Bool) {
    let viewControllers = isRightToLeft ? viewControllers.reversed() : viewControllers

    // Need to trigger a layout here to ensure that the scroll view
    // bounds is updated before we use its frame for calculations.
    view.layoutIfNeeded()

    for (index, viewController) in viewControllers.enumerated() {
      switch options.contentNavigationOrientation {
