From e957a1eddaa4194bfeeb0536fe985dde88e08ebc Mon Sep 17 00:00:00 2001 From: Pete Smith Date: Thu, 29 Dec 2016 20:19:06 +0000 Subject: [PATCH] Pass animation parameter --- ScalingCarousel/Classes/ScalingCarouselView.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ScalingCarousel/Classes/ScalingCarouselView.swift b/ScalingCarousel/Classes/ScalingCarouselView.swift index 6400a7b..dba5f09 100644 --- a/ScalingCarousel/Classes/ScalingCarouselView.swift +++ b/ScalingCarousel/Classes/ScalingCarouselView.swift @@ -72,7 +72,7 @@ open class ScalingCarouselView: UICollectionView { } override open func scrollRectToVisible(_ rect: CGRect, animated: Bool) { - invisibleScrollView.setContentOffset(rect.origin, animated: false) + invisibleScrollView.setContentOffset(rect.origin, animated: animated) } override open func scrollToItem(at indexPath: IndexPath, at scrollPosition: UICollectionViewScrollPosition, animated: Bool) { @@ -80,7 +80,7 @@ open class ScalingCarouselView: UICollectionView { let originX = (CGFloat(indexPath.item) * (frame.size.width - (inset * 2))) let rect = CGRect(x: originX, y: 0, width: frame.size.width - (inset * 2), height: frame.height) - scrollRectToVisible(rect, animated: false) + scrollRectToVisible(rect, animated: animated) } // MARK: - Configuration