I recently found myself in a situation where I needed to listen out for changes to a UIScrollView of which I couldn’t set the delegate. I have 2 views, they all want to be delegate of the scrollView but it only can set one view, how about the second view. My situation was I want get state scrollViewWillEndDragging
to set scrollView's contentInset but I couldn’t set the delegate. maybe I can use KVO but I don't know how to do?
I found this solution in Objective-c. http://sam.dods.co/blog/2014/08/03/secondary-delegate/
but in Swift 'NSMethodSignature' is unavailable in Swift: NSInvocation and related APIs not available