Skip to content

Commit 0c35503

Browse files
committed
feat: add support for scrollViewDidEndScrollingAnimation(_:) delegate method
1 parent d07064e commit 0c35503

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Sources/ScrollStackController/ScrollStack.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,14 @@ open class ScrollStack: UIScrollView, UIScrollViewDelegate {
10661066
dispatchRowsVisibilityChangesTo(stackDelegate)
10671067
}
10681068

1069+
public func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
1070+
guard let stackDelegate = stackDelegate else {
1071+
return
1072+
}
1073+
1074+
stackDelegate.scrollStackDidEndScrollingAnimation(self)
1075+
}
1076+
10691077
open override func layoutSubviews() {
10701078
super.layoutSubviews()
10711079

Sources/ScrollStackController/Support/ScrollStack+Protocols.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ public protocol ScrollStackControllerDelegate: AnyObject {
6868
/// - Parameter offset: current scroll offset.
6969
func scrollStackDidScroll(_ stackView: ScrollStack, offset: CGPoint)
7070

71+
/// Tells the delegate when a scrolling animation in the scroll view concludes.
72+
///
73+
/// - Parameter stackView: The ScrollStack object that’s performing the scrolling animation.
74+
func scrollStackDidEndScrollingAnimation(_ stackView: ScrollStack)
75+
7176
/// Row did become partially or entirely visible.
7277
///
7378
/// - Parameter row: target row.

0 commit comments

Comments
 (0)