You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2021. It is now read-only.
MDFScrollViewDelegateMultiplexer acts as a proxy object for UIScrollViewDelegate events and forwards all received events to an ordered list of registered observers.
This class acts as a proxy object for UIScrollViewDelegate events and forwards all received
events to an ordered list of registered observers.
Installation
Requirements
Xcode 7.0 or higher.
iOS SDK version 9.0 or higher.
Installation with CocoaPods
To add this component to your Xcode project using CocoaPods, add the following to your Podfile:
pod 'MDFScrollViewDelegateMultiplexer'
Then, run the following command:
pod install
Overview
When a UIScrollViewDelegate method invocation is received by the multiplexer, the multiplexer
forwards the invocation to each observer in order of registration.
If the scroll view method signature has a return value, after all delegate method invocations,
the return value will be provided by the first observing delegate that responded. If no
observers implement the method, a default return value will be used.
However, if a combiner is set and the receiving class conforms to the
MDFScrollViewDelegateCombining protocol, then the receiving class can designate which result
value to return via the use of the optional protocol methods.
And finally return the desired observer's results from the combiner method:
- (UIView *)scrollViewDelegateMultiplexer:(MDFScrollViewDelegateMultiplexer *)multiplexer
viewForZoomingWithResults:(NSPointerArray *)results
fromRespondingObservers:(NSArray *)respondingObservers {
// Lets return the results from the observer which is equal to self.if (respondingObservers[0] == self) {
return [results pointerAtIndex:0];
}
returnnil;
}
About
MDFScrollViewDelegateMultiplexer acts as a proxy object for UIScrollViewDelegate events and forwards all received events to an ordered list of registered observers.