Add a vertical UIScrollView into another vertical UIScrollView on iOS. It makes users feel like it's a single UIScrollView. This tool resolve the gesture conflict between thw two UIScrollViews.
How it works: Hook the scrollViewDidScroll
method of a UIScrollView by SwiftHook, calculate and reset the offset
of the UIScrollView.
It supports Swift and Objective-C
Just one line code to do it!
outerScrollView.embeddedScrollView = embeddedScrollView
The API is in an extension.
extension UIScrollView {
@objc public var embeddedScrollView: UIScrollView?
}
EmbeddedScrollView can be integrated by cocoapods.
pod 'EmbeddedScrollView'
Or use Swift Package Manager. SPM is supported from 1.1.0.
- iOS 10.0+
- Xcode 11+
- Swift 5.0+