From 20d98f04793d9409579380e0a36d9b0848060d3e Mon Sep 17 00:00:00 2001 From: Ace Green Date: Sat, 12 Aug 2017 21:08:00 -0400 Subject: [PATCH] adds variable scroll speed [issue #26] --- Pod/Classes/PickerView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Pod/Classes/PickerView.swift b/Pod/Classes/PickerView.swift index c9093b7..22240c8 100644 --- a/Pod/Classes/PickerView.swift +++ b/Pod/Classes/PickerView.swift @@ -159,6 +159,7 @@ open class PickerView: UIView { lazy var collectionView: UICollectionView = { self.layout.estimatedItemSize = CGSize(width: self.rowHeight, height: self.rowHeight) let collectionView = UICollectionView(frame: .zero, collectionViewLayout: self.layout) + collectionView.decelerationRate = self.scrollSpeed return collectionView }() @@ -221,6 +222,8 @@ open class PickerView: UIView { } } + open var scrollSpeed: CGFloat = UIScrollViewDecelerationRateNormal + // MARK: Initialization required public init?(coder aDecoder: NSCoder) {