Skip to content

Commit

Permalink
adds variable scroll speed [issue filipealva#26]
Browse files Browse the repository at this point in the history
  • Loading branch information
acegreen committed Aug 13, 2017
1 parent fefb5b4 commit 1e04546
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Pod/Classes/PickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ open class PickerView: UIView {
}
}

open var scrollSpeed: CGFloat = UIScrollViewDecelerationRateNormal

// MARK: Initialization

required public init?(coder aDecoder: NSCoder) {
Expand Down Expand Up @@ -248,6 +250,7 @@ open class PickerView: UIView {
tableView.showsVerticalScrollIndicator = false
tableView.showsHorizontalScrollIndicator = false
tableView.scrollsToTop = false
tableView.decelerationRate = scrollSpeed
tableView.register(SimplePickerTableViewCell.classForCoder(), forCellReuseIdentifier: self.pickerViewCellIdentifier)
tableView.translatesAutoresizingMaskIntoConstraints = false
addSubview(tableView)
Expand Down

0 comments on commit 1e04546

Please sign in to comment.