Skip to content

Commit

Permalink
Make gestureOptions.decelarationRate the source of truth (#662)
Browse files Browse the repository at this point in the history
* making gesture options decelaration rate the source of truth

* clean up changelog

* fix indentation
  • Loading branch information
Neel Mistry authored and nishant-karajgikar committed Sep 22, 2021
1 parent 9a14315 commit e01f606
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Mapbox welcomes participation and contributions from everyone.
* `PointAnnotationManager.textVariableAnchor` is now of type `[TextAnchor]?` instead of `[String]?` ([#650](https://github.com/mapbox/mapbox-maps-ios/pull/650))
* `PointAnnotationManager.textWritingMode` is now of type `[TextWritingMode]?` instead of `[String]?` ([#650](https://github.com/mapbox/mapbox-maps-ios/pull/650))
* `GestureOptions.hapticFeedbackEnabled` has been removed. ([#663](https://github.com/mapbox/mapbox-maps-ios/pull/663))
* `GestureManager.decelarationRate` has been removed and `GestureOptions.decelerationRate` is the single source of truth. ([#662](https://github.com/mapbox/mapbox-maps-ios/pull/662))

### Features ✨ and improvements 🏁

Expand Down
6 changes: 1 addition & 5 deletions Sources/MapboxMaps/Gestures/GestureManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ public final class GestureManager: NSObject {
/// Set this delegate to be called back if a gesture begins
public weak var delegate: GestureManagerDelegate?

/// A floating-point value that determines the rate of deceleration after the
/// user lifts their finger.
public var decelerationRate: CGFloat = UIScrollView.DecelerationRate.normal.rawValue

internal init(view: UIView, cameraAnimationsManager: CameraAnimationsManagerProtocol, mapboxMap: MapboxMap) {
self.view = view
self.cameraAnimationsManager = cameraAnimationsManager
Expand Down Expand Up @@ -237,7 +233,7 @@ extension GestureManager: GestureHandlerDelegate {
let driftCameraOptions = mapboxMap.dragCameraOptions(from: endPoint, to: driftEndPoint)
_ = cameraAnimationsManager.ease(
to: driftCameraOptions,
duration: Double(decelerationRate),
duration: Double(options.decelerationRate),
curve: .easeOut,
completion: nil)
}
Expand Down

0 comments on commit e01f606

Please sign in to comment.