https://github.com/623637646/embeddedscrollview
Embedded UIScrollView for iOS.
https://github.com/623637646/embeddedscrollview
embed embedded embeddings nest nested scrolling scrollview uiscrollview
Last synced: 11 months ago
JSON representation
Embedded UIScrollView for iOS.
- Host: GitHub
- URL: https://github.com/623637646/embeddedscrollview
- Owner: 623637646
- License: mit
- Created: 2021-03-17T03:12:40.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-30T06:25:40.000Z (about 3 years ago)
- Last Synced: 2025-03-19T01:39:35.092Z (11 months ago)
- Topics: embed, embedded, embeddings, nest, nested, scrolling, scrollview, uiscrollview
- Language: Swift
- Homepage:
- Size: 76.2 KB
- Stars: 60
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EmbeddedScrollView
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](https://github.com/623637646/SwiftHook), calculate and reset the `offset` of the UIScrollView.
It supports Swift and Objective-C

# How to use EmbeddedScrollView
Just one line code to do it!
```swift
outerScrollView.embeddedScrollView = embeddedScrollView
```
The API is in an extension.
```swift
extension UIScrollView {
@objc public var embeddedScrollView: UIScrollView?
}
```
# How to integrate EmbeddedScrollView?
**EmbeddedScrollView** can be integrated by [cocoapods](https://cocoapods.org/).
```
pod 'EmbeddedScrollView'
```
Or use Swift Package Manager. SPM is supported from **1.1.0**.
# Requirements
- iOS 10.0+
- Xcode 11+
- Swift 5.0+