 
 	private var ignoresScrollViewDidScroll = 0
 	private var isSettingPrimaryViewControllerInternally = false
-	private var lastLayoutedViewSize = CGSize()
+	private var lastLayoutedSize = CGSize.zero
+	private var lastLayoutedSizeForChildren = CGSize.zero
 	private var reusableChildView: ChildView?
 	private var scrollCompletion: ScrollCompletion?
 	private var viewControllersNotYetMovedToParentViewController = [UIViewController]()


		let visibleIndexes: Range<Int>

		if viewControllers.isEmpty || viewBounds.isEmpty {
			visibleIndexes = 0 ..< 0
		}
		else {
			let floatingIndex = contentOffset.left / viewBounds.width
			visibleIndexes = Int(floor(floatingIndex)).clamp(min: 0, max: viewControllers.count - 1) ... Int(ceil(floatingIndex)).clamp(min: 0, max: viewControllers.count - 1)
		}


	public override func viewDidLayoutSubviewsWithAnimation(animation: Animation?) {
		super.viewDidLayoutSubviewsWithAnimation(animation)

		let bounds = view.bounds
		guard bounds.size != lastLayoutedSize else {
			return
		}

		lastLayoutedSize = bounds.size

		layoutChildrenForcingLayoutUpdate(false)
		updatePrimaryViewController()
	}

