Skip to content

Commit 29bf974

Browse files
committed
Bump to version 2.5.5
1 parent 4c77c6c commit 29bf974

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

FloatingPanel.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "FloatingPanel"
4-
s.version = "2.5.4"
4+
s.version = "2.5.5"
55
s.summary = "FloatingPanel is a clean and easy-to-use UI component of a floating panel interface."
66
s.description = <<-DESC
77
FloatingPanel is a clean and easy-to-use UI component for a new interface introduced in Apple Maps, Shortcuts and Stocks app.

Sources/Core.swift

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ class Core: NSObject, UIGestureRecognizerDelegate {
387387

388388
let velocity = value(of: panGesture.velocity(in: panGesture.view))
389389
let location = panGesture.location(in: surfaceView)
390-
390+
let offsetDiff = value(of: scrollView.contentOffset - contentOffsetForPinning(of: scrollView))
391+
391392
let belowEdgeMost = 0 > layoutAdapter.offsetFromMostExpandedAnchor + (1.0 / surfaceView.fp_displayScale)
392393

393394
log.debug("""
@@ -398,8 +399,6 @@ class Core: NSObject, UIGestureRecognizerDelegate {
398399
location = \(value(of: location)), velocity = \(velocity)
399400
""")
400401

401-
let offsetDiff = value(of: scrollView.contentOffset - contentOffsetForPinning(of: scrollView))
402-
403402
if belowEdgeMost {
404403
// Scroll offset pinning
405404
if state == layoutAdapter.mostExpandedState {
@@ -485,7 +484,11 @@ class Core: NSObject, UIGestureRecognizerDelegate {
485484
let translation = panGesture.translation(in: panGestureRecognizer.view!.superview)
486485
let velocity = panGesture.velocity(in: panGesture.view)
487486
let location = panGesture.location(in: panGesture.view)
488-
487+
if state == .full && translation.y <= 0 {
488+
layoutAdapter.interactionConstraint?.constant = layoutAdapter.initialConst
489+
return
490+
}
491+
489492
log.debug("""
490493
panel gesture(\(state):\(panGesture.state)) -- \
491494
translation = \(value(of: translation)), \
@@ -653,7 +656,7 @@ class Core: NSObject, UIGestureRecognizerDelegate {
653656
let next = pre + diff
654657

655658
if !layoutAdapter.canGoAboveTheTopAnchor && pre <= layoutAdapter.surfaceLocation(for: .full).y && translation.y <= 0 {
656-
return
659+
guard (layoutAdapter.initialConst + diff) >= layoutAdapter.surfaceLocation(for: .full).y else { return }
657660
}
658661

659662
layoutAdapter.updateInteractiveEdgeConstraint(diff: diff,
@@ -1025,11 +1028,12 @@ class Core: NSObject, UIGestureRecognizerDelegate {
10251028
}
10261029

10271030
private func unlockScrollView() {
1028-
guard let scrollView = scrollView, scrollView.isLocked else { return }
1031+
guard let scrollView = scrollView else { return }
10291032
log.debug("unlock scroll view")
10301033

10311034
scrollView.isDirectionalLockEnabled = false
1032-
scrollView.bounces = scrollBounce
1035+
// scrollView.bounces = false
1036+
scrollView.alwaysBounceVertical = true
10331037
scrollView.showsVerticalScrollIndicator = scrollIndictorVisible
10341038
}
10351039

Sources/Layout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class LayoutAdapter {
8686
return vc.fp_safeAreaInsets
8787
}
8888

89-
private var initialConst: CGFloat = 0.0
89+
var initialConst: CGFloat = 0.0
9090

9191
private var fixedConstraints: [NSLayoutConstraint] = []
9292

0 commit comments

Comments
 (0)