scrollView(_:handle:completion:)
Handles a scroll update before the scroll view reacts to it.
Declaration
optional func scrollView(_ scrollView: BEScrollView, handle scrollUpdate: BEScrollViewScrollUpdate, completion: @escaping (Bool) -> Void)optional func scrollView(_ scrollView: BEScrollView, handle scrollUpdate: BEScrollViewScrollUpdate) async -> BoolParameters
- scrollView:
The Bescrollview that receives the scroll update.
- scrollUpdate:
An object that describes the scroll update. Retrieve all information from this object immediately on the main queue when the system calls your delegate method, as the values may change.
- completion:
A block to call when you finish processing the scroll update. Pass
trueif you handled the scroll event and the scroll view doesn’t need to react to it; passfalseotherwise.
Discussion
Your BEScrollViewDelegate receives scroll updates before its delegating scroll view handles them. The system calls this method on the main queue — retrieve information from scrollUpdate on the main queue, then process the update asynchronously. Call the completion block asynchronously on the main queue when you finish processing.