Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 972 Bytes

Manage_UIScrollViewDelegate_Events.md

File metadata and controls

36 lines (28 loc) · 972 Bytes

< Back to Index

6 - APIs: Listen for UIScrollViewDelegate events

Both TableDirector and CollectionDirector/FlowCollectionDirector expose a property called scrollEvents.

From this property you can attach a list of events for the inner UIScrollView which are the same usually exposed via UIScrollViewDelegate.

Available Events

Event
didScroll
endScrollingAnimation
shouldScrollToTop
didScrollToTop
willBeginDragging
willEndDragging
endDragging
willBeginDecelerating
endDecelerating
viewForZooming
willBeginZooming
endZooming
didZoom
didChangeAdjustedContentInset

Each attachable event has the same parameters and output of the UIScrollViewDelegate counterpart.

Example:

director?.scrollEvents.didScroll = { scrollView in
	debugPrint("Scrolled to \(scrollView.contentOffset.y)")
}