Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dkk/ScrollViewIfNeeded
A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View
https://github.com/dkk/ScrollViewIfNeeded
Last synced: about 2 months ago
JSON representation
A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View
- Host: GitHub
- URL: https://github.com/dkk/ScrollViewIfNeeded
- Owner: dkk
- License: mit
- Created: 2021-12-03T09:25:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-29T16:53:21.000Z (about 2 years ago)
- Last Synced: 2024-08-03T18:13:32.174Z (5 months ago)
- Language: Swift
- Size: 7.81 KB
- Stars: 38
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-swiftui-libraries - ScrollViewIfNeeded - A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View (Scroll / Content)
README
# ScrollViewIfNeeded
A SwiftUI ScrollView that only scrolls if the content doesn't fit in the View## Installation
Requirements iOS 13+### Swift Package Manager
1. In Xcode, open your project and navigate to File → Swift Packages → Add Package Dependency.
2. Paste the repository URL (https://github.com/dkk/ScrollViewIfNeeded) and click Next.
3. For Rules, select version.
4. Click Finish.### Add as dependency to another package
```swift
.package(url: "https://github.com/dkk/ScrollViewIfNeeded", .upToNextMajor(from: "1.0.0"))
```### Manual installation
Copy `/Sources/ScrollViewIfNeeded/ScrollViewIfNeeded.swift` into your project
## Usage
Import the ScrollViewIfNeeded package to your view:
```swift
import ScrollViewIfNeeded
```use it like you would use `ScrollView`:
```swift
ScrollViewIfNeeded {
/* your content */
}
```or configure it the same way you would configure `ScrollView`:
```swift
ScrollViewIfNeeded(.horizontal, showsIndicators: false) {
/* your content */
}
```## Contribute
You can contribute to this project by helping me solve any [reported issues or feature requests](https://github.com/dkk/ScrollViewIfNeeded/issues) and creating a pull request.## Support
If you just want to say thanks, you could [buy me a coffee ☕️](https://www.buymeacoffee.com/kloeck).## License
ScrollViewIfNeeded is released under the [MIT License](LICENSE).