https://github.com/lightsprint09/sourcing
Abstracts TableView & CollectionView DataSources
https://github.com/lightsprint09/sourcing
carthage custom-dataprovider dataprovider datasource sourcing swift tableview
Last synced: about 2 months ago
JSON representation
Abstracts TableView & CollectionView DataSources
- Host: GitHub
- URL: https://github.com/lightsprint09/sourcing
- Owner: lightsprint09
- License: mit
- Created: 2016-05-27T18:26:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-01-31T06:31:06.000Z (4 months ago)
- Last Synced: 2025-03-13T18:03:35.750Z (2 months ago)
- Topics: carthage, custom-dataprovider, dataprovider, datasource, sourcing, swift, tableview
- Language: Swift
- Homepage:
- Size: 1.17 MB
- Stars: 17
- Watchers: 4
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/lightsprint09/Sourcing)
[](https://github.com/Carthage/Carthage)
[](https://codecov.io/gh/lightsprint09/Sourcing)# Sourcing
Typesafe and flexible abstraction for TableView & CollectionView DataSources written in Swift. It helps you to seperate concerns and keep ViewControllers light. By operating on data providers replacing your view implementation is easy at any time.
## Documentation
Read the [docs](https://lightsprint09.github.io/Sourcing). Generated with [jazzy](https://github.com/realm/jazzy). Hosted by [GitHub Pages](https://pages.github.com).
## Quick Demo
Setting up your Cell by implementing `ConfigurableCell` & `ReuseIdentifierProviding`.
```swift
import Sourcingclass LabelCell: UITableViewCell, ConfigurableCell {
func configure(with label: String) {
textLabel?.text = label
}
}//If the reuse identifier is the same as the class name.
extension LabelCell: ReuseIdentifierProviding {}let labelCellConfiguration = CellConfiguration()
let labelsToDispay = ArrayDataProvider(sections: [["Row 1", "Row 2"], ["Row 1", "Row 2"]])
let dataSource = TableViewDataSource(dataProvider: labelsToDispay, cellConfiguration: labelCellConfiguration)tableView.dataSource = dataSource
//Add this to sync data changes to the table view.
let changeAnimator = TableViewChangeAnimator(tableView: tableView, dataProvider: labelsToDispay)
```## Installation
### Swift Package Manager
[SPM](https://swift.org/package-manager/) is integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
Specify the following in your `Package.swift`:
```swift
.package(url: "https://github.com/lightsprint09/Sourcing", from: "4.1.0"),
```## Contributing
See CONTRIBUTING for details.## Contact
Lukas Schmidt ([Mail](mailto:[email protected]), [@lightsprint09](https://twitter.com/lightsprint09))## License
Sourcing is released under the MIT license. See LICENSE for details.