Commit 37a45923 by Demid Merzlyakov

IOS-95 [Crashlytics]: fix crash in handleTapGesture in MapTimeControlView, when…

IOS-95 [Crashlytics]: fix crash in handleTapGesture in MapTimeControlView, when currentItems are empty.
parent 475d21c2
......@@ -170,6 +170,9 @@ class MapTimeControlView: UIView {
}
@objc private func handleTapGesture(gestureRecoginzer:UIGestureRecognizer) {
guard !currentItems.isEmpty else {
return
}
let location = gestureRecoginzer.location(in: self)
let progress = max(location.x - stackView.frame.origin.x, 0) / (self.bounds.width - stackView.frame.origin.x)
let targetIndex = Int(CGFloat(currentItems.count) * progress)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment