Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sreznic/InfiniteScroller
Horizontal and Vertical collection view for infinite scrolling that was designed to be used in SwiftUI
https://github.com/sreznic/InfiniteScroller
Last synced: 4 months ago
JSON representation
Horizontal and Vertical collection view for infinite scrolling that was designed to be used in SwiftUI
- Host: GitHub
- URL: https://github.com/sreznic/InfiniteScroller
- Owner: sreznic
- License: mit
- Created: 2020-08-27T19:12:21.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-28T19:09:58.000Z (about 4 years ago)
- Last Synced: 2024-09-21T10:30:59.302Z (4 months ago)
- Language: Swift
- Homepage:
- Size: 2.66 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- fucking-about-SwiftUI - InfiniteScroller
README
# InfiniteScroller
[![Swift Version][swift-image]][swift-url]
[![License][license-image]][license-url]
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
## Example
```swift
struct ContentView: View {
@State var selected: Int = 1
var body: some View {
InfiniteScroller(direction: .vertical(height: 50), items: [1,2,3,4],
selectedItem: $selected, visibleCells: 3, cellSpacing: 0) { Text("\($0)") }
}
}
```
and you good to go.
But if something doesn't go well, you can always clone the repo and check 'Example' folder### Updating
If you need to update cells which has already been loaded, you can enable this feature by passing
'updating' argument to the constructor of InfiniteScroller and setting it to true. Recommended to be disabled if you
don't need this feature### How it works?
It uses InfiniteLayout library(https://github.com/arnauddorgans/InfiniteLayout) underneath, so you can extend its functionality
## Installation
### [Swift Package Manager](https://github.com/apple/swift-package-manager)
Select File > Swift Packages > Add Package Dependency and enter https://github.com/cointowitcher/InfiniteScroller.git## Known issues
- Items aren't displayed correctly if the amount of the items is less or equal to visibleCells parameter. So, make sure to pass more items than visible cells
## Contribute
We would love you to contribute to this project, the project is opened for modifications.
## License
InfiniteScroller is available under the MIT license. See the LICENSE file for more info.
[swift-image]:https://img.shields.io/badge/swift-5.2-orange.svg
[swift-url]: https://swift.org/
[license-image]: https://img.shields.io/badge/License-MIT-blue.svg
[license-url]: LICENSE
[codebeat-image]: https://codebeat.co/badges/c19b47ea-2f9d-45df-8458-b2d952fe9dad
[codebeat-url]: https://codebeat.co/projects/github-com-vsouza-awesomeios-com