Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/623637646/embeddedscrollview
Embedded UIScrollView for iOS.
https://github.com/623637646/embeddedscrollview
embed embedded embeddings nest nested scrolling scrollview uiscrollview
Last synced: 2 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 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-30T06:25:40.000Z (almost 2 years ago)
- Last Synced: 2024-09-17T14:41:13.067Z (4 months ago)
- Topics: embed, embedded, embeddings, nest, nested, scrolling, scrollview, uiscrollview
- Language: Swift
- Homepage:
- Size: 76.2 KB
- Stars: 60
- Watchers: 4
- 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
![ezgif com-gif-maker](https://user-images.githubusercontent.com/5275802/111632055-0f82c180-882f-11eb-87de-a8480dab060a.gif)
# 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+