From dc44eaec336fb300de44f83987dd3a2dcd62d9ac Mon Sep 17 00:00:00 2001 From: Pete Smith Date: Tue, 3 Jan 2017 19:50:12 +0000 Subject: [PATCH] Correct content height --- ScalingCarousel/Classes/ScalingCarouselView.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ScalingCarousel/Classes/ScalingCarouselView.swift b/ScalingCarousel/Classes/ScalingCarouselView.swift index be808d4..e156702 100644 --- a/ScalingCarousel/Classes/ScalingCarouselView.swift +++ b/ScalingCarousel/Classes/ScalingCarouselView.swift @@ -44,7 +44,8 @@ open class ScalingCarouselView: UICollectionView { } // Set the invisibleScrollView contentSize width based on number of items - invisibleScrollView.contentSize.width = invisibleScrollView.frame.width * CGFloat(numberItems) + let contentWidth = invisibleScrollView.frame.width * CGFloat(numberItems) + invisibleScrollView.contentSize = CGSize(width: contentWidth, height: invisibleScrollView.frame.height) } } @@ -108,6 +109,8 @@ open class ScalingCarouselView: UICollectionView { invisibleScrollView.isPagingEnabled = true invisibleScrollView.showsHorizontalScrollIndicator = false + + print("Frame size: \(frame.size)") invisibleScrollView.contentSize = frame.size // Turn off interaction on the overlay so touch events fall through to the main scroll view